Sub topic 3
Boolean identities and laws
This chapter assumes you can read a truth table and know what AND, OR, and NOT gates do. It uses the notation common in GATE papers: + is OR, writing two variables side by side is AND (AB), and a prime is NOT (A').
The working model
Boolean algebra has two values, 0 and 1, and a small set of identities. Each identity says two expressions give the same output on every input row. You simplify an expression by replacing a part of it with an equal part that has fewer literals or terms. A literal is one appearance of a variable, complemented or not.
Almost every law comes in a pair. The second member of the pair swaps + with · and swaps 0 with 1. The next chapter explains why this duality works. For now, learn each law in both forms.
The core laws
| Law | AND form | OR form |
|---|---|---|
| Identity | `A·1 = A` | `A + 0 = A` |
| Null (domination) | `A·0 = 0` | `A + 1 = 1` |
| Idempotent | `A·A = A` | `A + A = A` |
| Complement | `A·A' = 0` | `A + A' = 1` |
| Involution | `(A')' = A` | `(A')' = A` |
| Commutative | `AB = BA` | `A + B = B + A` |
| Associative | `(AB)C = A(BC)` | `(A+B)+C = A+(B+C)` |
| Distributive | `A(B + C) = AB + AC` | `A + BC = (A+B)(A+C)` |
| Absorption | `A(A + B) = A` | `A + AB = A` |
| Redundancy | `A(A' + B) = AB` | `A + A'B = A + B` |
| Consensus | `(A+B)(A'+C)(B+C) = (A+B)(A'+C)` | `AB + A'C + BC = AB + A'C` |
The OR-over-AND distributive law, A + BC = (A+B)(A+C), has no counterpart in ordinary arithmetic. It is the one most often forgotten.
Why absorption and redundancy hold
Absorption follows from identity, null, and distribution:
A + AB = A·1 + AB = A(1 + B) = A·1 = ARedundancy follows by distributing the OR form and applying the complement law:
A + A'B = (A + A')(A + B) = 1·(A + B) = A + BThis is the most useful shortcut in algebraic simplification. If a term is complemented in the other term, you can delete that literal. In A + A'B, the A' is deleted because A already covers every row where A = 1.
The consensus theorem
In AB + A'C + BC, the variable A appears true in one term and complemented in another. The third term BC is the consensus of the first two: it contains the remaining literals, B and C. The theorem says BC is redundant.
Proof:
AB + A'C + BC
= AB + A'C + BC(A + A')
= AB + A'C + ABC + A'BC
= AB(1 + C) + A'C(1 + B)
= AB + A'CThe idea is simple. Whenever BC = 1, either A = 1 (so AB = 1) or A = 0 (so A'C = 1). One of the other two terms already covers the case.
Conditions for consensus
Consensus applies only when exactly one variable appears in opposite forms across the two terms. Check these points before deleting a term:
- The two source terms must have exactly one complementary pair.
ABandA'B'have two (A and B), so they give no consensus term. - The consensus term is built from all other literals of both terms. For
ABDandA'CE, it isBDCE, not justBC. - The consensus term can also be added to an expression. This is useful when it lets two other terms be absorbed.
Checking a law mechanically
A truth table is a complete proof, because a function of n variables has only 2^n rows. The following program tests laws, including two false "laws" that people often write by mistake.
from itertools import product
def equivalent(f, g, n):
return all(f(*v) == g(*v) for v in product([0, 1], repeat=n))
def NOT(x):
return 1 - x
checks = {
"absorption A + AB = A":
(lambda a, b: a | (a & b), lambda a, b: a, 2),
"redundancy A + A'B = A + B":
(lambda a, b: a | (NOT(a) & b), lambda a, b: a | b, 2),
"distributive A + BC = (A+B)(A+C)":
(lambda a, b, c: a | (b & c),
lambda a, b, c: (a | b) & (a | c), 3),
"consensus AB + A'C + BC = AB + A'C":
(lambda a, b, c: (a & b) | (NOT(a) & c) | (b & c),
lambda a, b, c: (a & b) | (NOT(a) & c), 3),
"WRONG: A + BC = (A+B)C":
(lambda a, b, c: a | (b & c),
lambda a, b, c: (a | b) & c, 3),
"WRONG: AB + AC + BC = AB + AC":
(lambda a, b, c: (a & b) | (a & c) | (b & c),
lambda a, b, c: (a & b) | (a & c), 3),
}
for name, (f, g, n) in checks.items():
print(name, "->", equivalent(f, g, n))The first four lines print True and the two WRONG lines print False. The last one fails because AB and AC share no complemented variable, so BC is not a consensus term. At A=0, B=1, C=1 the left side is 1 and the right side is 0.
Worked examples
Example 1: consensus then absorption
Simplify F = AB + A'C + BC + BCD.
BCabsorbsBCD, becauseX + XY = XwithX = BC. NowF = AB + A'C + BC.BCis the consensus ofABandA'C, so it is deleted.
The result is F = AB + A'C. The literal count falls from 9 to 4.
Example 2: redundancy applied twice
Simplify F = A + A'B + A'B'C.
- Factor the last two terms:
F = A + A'(B + B'C). - Apply redundancy inside the bracket:
B + B'C = B + C. NowF = A + A'(B + C). - Apply redundancy again:
A + A'X = A + X, soF = A + B + C.
This is the shortcut GATE questions reward. You do not need a K-map for it.
Common errors
- Treating
+as addition.A + A = A, not2A, andA + 1 = 1. - Cancelling like algebra. From
AB = ACyou cannot concludeB = C. IfA = 0, both sides are 0 for anyBandC. - Forgetting the OR-over-AND distributive law, then failing to expand or factor products of sums.
- Applying consensus when two pairs are complemented, or building the consensus term from only part of the literals.
- Deleting the wrong term. In
AB + A'C + BC, you deleteBC, notABorA'C. - Complementing term by term.
(AB)'is notA'B'. De Morgan's laws, covered next, give the correct form.
Exercise
Simplify F = (A + B)(A' + C)(B + C) and state which law you used.
Show answer
Use the product-of-sums form of consensus. The factor (B + C) is built from the complementary pair A and A' in the other two factors, so it is redundant. F = (A + B)(A' + C). Check at A=0, B=0, C=1: the original gives 0·1·1 = 0 and the result gives 0·1 = 0, which matches.
Exercise
Simplify F = XY + X'Z + YZ + X'YZ and give the final literal count.
Show answer
X'YZ is absorbed by YZ (it contains all literals of YZ), leaving XY + X'Z + YZ. YZ is the consensus of XY and X'Z, so it is deleted. F = XY + X'Z, which has 4 literals, down from 9.