Sales Toll Free No: 1-855-666-7446

# Boolean Operators

Top
 Sub Topics A function in the form f: Rk ⇢ S, where values of ‘R’ are equals 0 or 1 and value of ‘k’ is non negative Integer is known as Boolean function. Now we will see the Boolean operators. There are three types of Boolean operators which are given below: 1. AND operator, AND operator is also known as conjunction operator. The representation of AND operator is ‘∧’ 2. OR operator, OR operator is also known as disjunction operator. The representation of or operator is ‘∨’ 3. Negation of OR operation is known as NOT operator. The representation of negation operator is ‘~’. Now we will see the truth table of all the operators: Truth table for AND operator is: | R | S | R ∧S | | T | T | T | | T | F | F | | F | T | F | | F | F | F | Now we discuss the meaning of these operators: If both values are true then we get true in case of AND operator; If both values of ‘R’ are true and value of ‘S’ is false then we get the result false; If both values of ‘R’ are false and value of ‘S’ is true then we get the result false; If both values are false then we get the result false; Truth table for OR operator is: | R | S | R ∨S | | T | T | T | | T | F | T | | F | T | T | | F | F | F | Now we will see the truth table for negation operator: | R | ~R | | T | F | | F | T | If value of ‘R’ is true then the negation of ‘R’ is false. If value of ‘R’ is false then the negation of ‘R’ is true. This is all about Boolean operator.

## Boolean Expressions

Boolean expressions are expressions whose solutions are Binary Numbers that are represented by just two digits: 0 and 1. In a Boolean expression we work according to Boolean Algebra which implements operations between 2 numbers to get a Boolean result. Uses of binary algebra can be found in many computer applications which involve solving circuits and procedures for displaying the output on screen.

Notion before applying boolean algebra is established on the fact that it makes use of sensibleness i.e. result either would be 0 & 1, 0 or 1, or nothing. Let us learn Boolean expressions.
Boolean algebra operators used in answering Math problems having Boolean expressions like: “AND” operator: it is denoted by a dot symbol “•” and its expression would look like: X • Y. In simple language we can assume it to be the product of 2 binary numbers. “OR” operator: It is denoted by “+” sign and its expression is written as follows: X + Y. It is also known as summation of 2 binary numbers.

We also have:
A + A' = 1, and A • A' = 0,
Laws to be followed in Boolean algebra are as follows:
1. Commutativity of Boolean expressions frames our 1st law i.e. A + C is identical to Boolean expression A + C and also A • C is identical to writing A • C.

2. Secondly, associativity of Boolean expressions is another such law that can be discussed as follows: (A + D) + C is identical to (A + C) + D. For dot operation we follow the same rule.

3. Last is the distribution property of Boolean expressions according to which: A • (C + B) = A • C + A • B and A + (C • B) = (A + C) • (C + B).

## Logical And Operations

We can perform different logical operations such as And, Or, Not, XOR etc. Logical operations take value in binary form means 0, 1 (0 → false , 1 → true) as input. Logical AND operation represents multiplication operation. Suppose we have two values a, b and if we apply Logical And Operations on them, then there are four cases:

Case 1:- If value of a = 0, and b = 0, a and b both are false, then “And” of these two values is a and b => a * b = > 0 * 0 = 0 ( false ). So we can say that “And ” operation on two false value gives false value.

Case 2 :- If value of a = 0, and b = 1, means 'a' is false and 'b' is true, then “And” of 'a' and 'b' is , a * b => 0 * 1 = 0 ( false ), so we can say that and operation on two values where one is true and other is false gives false result.

Case 3:- If value of a = 1 and b = 0, means 'a' is true and 'b' is false, then “And” of a and b is, a * b => 1 * 0 = 0 (false). Means if one value is false and other is true then result is false .

Case 4:- If value of a = 1, b = 1, means both values are true, then in this case “And” of 'a' and 'b' is,
a * b = 1 * 1 = 1 (true). If both values are true then result is also true.

## Logical Or Operations

Logical Or operation represents the operation of addition. Suppose we have two values a, b and if we apply Logical Or Operations on them, then we will denote this as, "a or b", a + b. There are four case of Logical Or Operations on a and b are:-

Case 1:- If value of a = 0, and b = 0, a and b both are false, then “Or” of these two values is, a Or b => a + b = > 0 * 0 = 0 (false). So we can say that, “Or” operation on two false value gives false result.

Case 2:- If value of a = 0, and b = 1, means 'a' is false and 'b' is true, then “ Or ” of a and b is, a + b => 0 + 1 = 1 (true), so we can say that, 'And' operation on two values where one is true and other is false gives true result.

Case 3:- If value of a = 1 and b = 0, means 'a' is true and 'b' is false, then “Or” of a and b is, a + b => 1 + 0 = 1 (false). Means if one value is true and other is false then result is true .

Case 4:- If value of a = 1, b = 1, means both values are true, then in this case “Or” of 'a' and 'b' is,
a + b = 1 + 1 = 1 ( true ). If both values are true then result is also true.

## Logical Not Operations

Logical operators can be defined as those operators which are used to compare two conditions at a time for confirming whether a row can be selected for output or not. Logical operators are mainly used with Boolean values. There are mainly three types of logic operators used, they are AND, OR, and NOT logical operators. Other logical gates such as X-OR, NAND operator, NOR operator etc. are derived from the basic three operators (AND, OR, and NOT).
AND, OR, and NOT logical operators are indicated by following mark:

AND operator is marked by (&&), OR operator is marked by (││), and NOT logical operators is indicated by (!).
If these operators are used with Boolean values then they return a Boolean value. “AND” and “OR” logical operators also return non-Boolean values if they are used with a non-Boolean value. All three logical operators (AND, OR, and NOT logical operators) are used to perform bitwise operations.
Let’s discuss Logical Not Operations.

NOT logical operator is one which returns an inverted output. That is if input is given one (1) through NOT logical operator then it will return zero (0) and also if input is zero (0), output will be one (1). In logical terms, NOT logical operator can be used to invert the input. That is if input is true, NOT operator converts it into false and vice versa. In other words, “NOT” operator produces opposite of expression which it results. If expression evaluates to True, NOT operator produces false and if expression results false, NOT gives True.
The bit on which operation is performed is called as operand. Logical “AND” and “OR” operator takes two operands to perform some operations. Bitwise NOT operator takes only single operand.
Symbol for NOT operator is:

Here A’ is representing inverted output,
 Input A Output A’ 1 0 0 1