There are three types of logical operators written in order of precedence below:
Truth table is used to calculate and record the value of any logical expression on the basis of the logical operators used.NOT Operator:
NOT operator can be symbolized as a bar above the variable, for example, ‘ x
’ or ‘NOT x’.
It is a unary operator. This operator produces opposite value of its operand, for if, the value is true, it will produce false and if it is false it will produce true.
The truth table for NOT operator is below.
|| NOT X
| 0 (FALSE)
|| 1 (TRUE)
| 1 (TRUE)|| 0 (FALSE)|
AND operator can be symbolized with a dot, for example, ‘A AND B’ or ‘A . B’ or ‘A ∧ B’.
It is a binary operator. This operator works like the multiplication operator. The value will only be true with this operator if both the input values are true. If either of the two operands is false, the final value will be false.
The truth table for AND operator is given below.
|| A ∧ B
| 0|| 1|| 0|
| 1|| 0|| 0|
| 1|| 1|| 1|
OR operator can be symbolized with a plus sign, for example, ‘A OR B’ or ‘A + B’ or ‘A ∨ B’.
It is a binary operator. This operator works like the addition operator. The value will only be false with this operator if both the input values are false. If either of two operands is true, the final value will be true. It is the negation of AND operator.
The truth table for OR operator is given below.
Solving Logical Expressions:
|| A ∨ B
| 0|| 1|| 1|
| 1|| 0|| 1|
| 1|| 1|| 1|
To solve logical expressions we proceed as following
1. First solve the parentheses if any.
2. Next solve the NOT operator.
3. Then the AND operator.
4. And lastly the OR operator.Laws of Boolean Expressions:
1. Commutative Law
A + B = B + A
A . B = B . A
2. Associative Law
(A + B) + C = A + (B + C)
A . (B . C) = (A . B) . C
3. Distributive Law
A . (B + C) = A . B + A . C
A + (B . C) = (A + B) . (A + C)
4. Identity Law
A + A = A
A . A = A
5. Redundance Law
A + A . B = A
A . (A + B) = A
6. De Morgan’s Theorem
Bar (A + B) = Bar A . Bar B
Bar AB = Bar A + Bar B
0 + A = A; 1 + A = 1
0 . A = 0; 1 . A = A
Bar A + A = 1; Bar A A=0Example 1:
Prove that C + Bar BC = Bar BSolution:
C + Bar BC = C + (Bar B + Bar C) using DeMorgan's Law
= (C + Bar C) + Bar B
= 1 + Bar B = Bar B Example 2:
Prove that (A + C)(AD + A Bar D) + AC + C = A + CSolution:
(A + C)(AD + A Bar D) + AC + C
= (A + C) A (D + Bar D) + C (A + 1)
= (A + C) A + C = AA + AC + C
= A + C (A + 1) = A + C