Boolean algebra and identities
The algebra of two values: postulates, the laws and identities (De Morgan, absorption, consensus), duality versus complement, XOR, the count of Boolean functions, and algebraic simplification.
Why it exists
A digital circuit is built from switches that are on or off. Boolean algebra is the arithmetic of such two-valued signals. It lets you take a description of what a circuit must do, rewrite it into the cheapest equivalent expression, prove that two circuits behave identically, and convert between gate types. Almost every other topic in this subject is an application: Karnaugh maps and Quine-McCluskey are systematic simplification, adders and multiplexers are built by writing the function and simplifying it, and flip-flop inputs are Boolean functions of the current state.
GATE asks three kinds of questions here: simplify an expression to a given form, decide whether two expressions are equal (or whether an identity holds), and count or characterise functions.
Prerequisites
None. This is a starting point.
None. Familiarity with the bitwise operators of C helps: &, |, ^ and ~ on single bits behave exactly like AND, OR, XOR and NOT.
Precise definitions
Boolean values and operations. A Boolean variable takes the value 0 or 1. The three basic operations are
| Operation | Notation | Value |
|---|---|---|
| AND | or | 1 only if both are 1 |
| OR | 0 only if both are 0 | |
| NOT | or | the other value |
Precedence. NOT first, then AND, then OR, unless parentheses say otherwise. So means , and means .
Boolean function. A function . It is completely described by its truth table with rows. Two expressions are equal exactly when their truth tables are equal. Consequently the number of different Boolean functions of variables is : 4 for , 16 for , 256 for , 65536 for .
Basic laws. For all (each law has an AND form and an OR form):
| Name | AND form | OR form |
|---|---|---|
| identity | ||
| null (annulment) | ||
| idempotent | ||
| complement | ||
| involution | ||
| commutative | ||
| associative | ||
| distributive | ||
| absorption | ||
| simplification | ||
| combining (adjacency) | ||
| consensus | ||
| De Morgan |
Note that the OR-over-AND distributive law, , has no counterpart in ordinary arithmetic.
De Morgan for many variables. and .
Complement of a function. To complement an expression, swap AND with OR and complement every literal (apply De Morgan repeatedly). Do not forget to keep the grouping. For the complement is (checked in example 4).
Dual. The dual of an expression is obtained by swapping AND with OR and 0 with 1, leaving the literals alone. As a function, . The duality principle: if two expressions are equal, their duals are equal. A function with is self-dual; the number of self-dual functions of variables is (4 for , 16 for ).
Complement is not dual. The dual of is , but its complement is .
XOR and XNOR. is 1 when the inputs differ. is 1 when they are equal. Properties: commutative, associative, , , , , , and . An -input XOR is 1 exactly when an odd number of inputs are 1 (the parity function), so it is 1 on half of the rows (). Complementing one input complements the output: .
Shannon expansion. For any function and variable : . It is the basis of multiplexer implementations.
No cancellation. From you cannot conclude , and likewise for (take for the first, for the second). Only if both hold can you cancel.
How it works
There is no hidden mechanism here: an identity is true if and only if its truth table is the same on both sides, so any claim can be checked mechanically. The program below checks four identities by looping over all assignments, exactly as a truth table does.
#include <stdio.h>
int main(void) {
int de_morgan = 1, absorb = 1, simplify = 1, distribute = 1;
printf("A B | A+A'B A+B | AB+AB' A\n");
for (int a = 0; a < 2; a++) {
for (int b = 0; b < 2; b++) {
int lhs = a || (!a && b);
int rhs = a || b;
int c1 = (a && b) || (a && !b);
printf("%d %d | %d %d | %d %d\n", a, b, lhs, rhs, c1, a);
if (lhs != rhs) simplify = 0;
if (c1 != a) absorb = 0;
if (!(a && b) != (!a || !b)) de_morgan = 0;
for (int c = 0; c < 2; c++)
if ((a || (b && c)) != ((a || b) && (a || c))) distribute = 0;
}
}
printf("De Morgan %d, combining %d, A+A'B=A+B %d, OR distributes over AND %d\n", de_morgan, absorb, simplify, distribute);
return 0;
}A B | A+A'B A+B | AB+AB' A
0 0 | 0 0 | 0 0
0 1 | 1 1 | 0 0
1 0 | 1 1 | 1 1
1 1 | 1 1 | 1 1
De Morgan 1, combining 1, A+A'B=A+B 1, OR distributes over AND 1The columns for and are identical, which proves the simplification law. The columns and are identical, which proves the combining law.
Step through three identities and one non-identity. Each table fills in one input row at a time, with the sub-expressions as separate columns, and the last step compares the two sides. Every cell is computed by a script, not typed in.
De Morgan: (AB)' = A' + B'
Computed exactly, not typed| A | B | AB | (AB)' | A' | B' | A'+B' |
|---|---|---|---|---|---|---|
| 0 | 0 | · | · | · | · | · |
| 0 | 1 | · | · | · | · | · |
| 1 | 0 | · | · | · | · | · |
| 1 | 1 | · | · | · | · | · |
Step 0
Claim: the complement of AND is the OR of the complements. Step through the rows; the highlighted columns are the two sides.
Simplification: A + A'B = A + B
Computed exactly, not typed| A | B | A' | A'B | A+A'B | A+B |
|---|---|---|---|---|---|
| 0 | 0 | · | · | · | · |
| 0 | 1 | · | · | · | · |
| 1 | 0 | · | · | · | · |
| 1 | 1 | · | · | · | · |
Step 0
Claim: once A is 1 the term A'B can add nothing, and when A is 0 it contributes exactly B. Step through the rows to check.
Consensus: AB + A'C + BC = AB + A'C
Computed exactly, not typed| A | B | C | AB | A'C | BC | AB+A'C+BC | AB+A'C |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | · | · | · | · | · |
| 0 | 0 | 1 | · | · | · | · | · |
| 0 | 1 | 0 | · | · | · | · | · |
| 0 | 1 | 1 | · | · | · | · | · |
| 1 | 0 | 0 | · | · | · | · | · |
| 1 | 0 | 1 | · | · | · | · | · |
| 1 | 1 | 0 | · | · | · | · | · |
| 1 | 1 | 1 | · | · | · | · | · |
Step 0
Claim: the term BC is redundant. Watch the BC column: wherever it is 1, one of AB or A'C is already 1.
The last table shows why "dual" and "complement" must not be confused: the dual of (swap the operators, keep the literals) is a different function from its complement, even though the dual does equal the complement of evaluated at complemented inputs.
The dual is not the complement
Computed exactly, not typed| A | B | C | F=AB+C' | dual (A+B)C' | complement (A'+B')C | F(A',B',C')' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | · | · | · | · |
| 0 | 0 | 1 | · | · | · | · |
| 0 | 1 | 0 | · | · | · | · |
| 0 | 1 | 1 | · | · | · | · |
| 1 | 0 | 0 | · | · | · | · |
| 1 | 0 | 1 | · | · | · | · |
| 1 | 1 | 0 | · | · | · | · |
| 1 | 1 | 1 | · | · | · | · |
Step 0
Claim: for F = AB + C' the dual and the complement are different functions, but the dual equals the complement of F evaluated at the complemented inputs (last column).
Method for simplification by algebra. Look for, in this order: common factors (distribute and combine), the pattern (replace by ), absorption , the consensus term in (delete it), then De Morgan to push complements down to single variables. If a result is not obviously minimal, switch to a Karnaugh map; algebra is quick when a pattern is visible and unreliable otherwise.
Worked examples
EX 1Combining
EasySimplify .
Step 1. Factor out : .
Step 2. The complement law gives .
Step 3. . (The truth-table program confirms it.)
EX 2Repeated use of x + x'y = x + y
MediumSimplify .
Step 1. Apply to the first two terms: . So .
Step 2. The last term is by De Morgan. Take ; the expression is .
Step 3. . Check: only when , and the original is also 0 only there.
EX 3Consensus theorem
MediumSimplify .
Step 1. The term is the consensus of and (the variable appears in true form in one term and complemented in the other, and is the product of the other literals).
Step 2. It is redundant: .
Proof of the theorem. , and is absorbed by , while is absorbed by .
EX 4Complement of an expression
GATE levelFind for and simplify.
Step 1 (truth table). for in . So for 000, 001 and 110.
Step 2. Those rows are . Combine the first two: . So .
Step 3 (check by De Morgan). . Multiply out: the product , and with gives again (since and remains, while the other products vanish).
EX 5Dual versus complement
GATE levelLet . Dual: swap and , keep literals: . Complement: .
They are different functions. For : and agree, but for : while . The identity holds: for that input , and its complement is 1, matching .
EX 6Counting functions
GATE level(a) The number of Boolean functions of 3 variables is .
(b) The number with exactly 3 true rows is .
(c) A function is self-dual when : the rows and (complementary inputs) must have opposite outputs. Choose the outputs of 4 of the pairs freely: self-dual functions of 3 variables.
(d) Of the 16 functions of 2 variables, 10 depend on both inputs. The other 6 are the constants 0 and 1, and , , , .
EX 7A parity chain
GATE levelHow many of the 16 input combinations of give ? The XOR of four inputs is 1 when an odd number of inputs is 1: . Complementing one input flips on every row.
Cheat box
Cheat box
- , , , , , , , .
- , , , , .
- Consensus: and .
- De Morgan: , (any number of variables).
- .
- Dual: swap with and with , keep literals. Complement: dual with every literal complemented.
- XOR: . Odd-parity function. , .
- functions of variables; of them self-dual; with exactly true rows.
- Precedence: NOT, AND, OR.
Traps and GATE patterns
Connections
Builds on
No prerequisites.
Unlocks
Across subjects
Within this subject
The expressions here become circuits in logic gates; the sum-of-products and product-of-sums forms built from minterms and maxterms are in SOP, POS, minterms and maxterms; systematic simplification is the Karnaugh map; and the statement that NAND (or NOR) alone is enough is in functional completeness and duality. The operators &, |, ^, ~ in C are this algebra applied to every bit of a word, see C types and operators.
PYQs
15 previous year questions from your book. I re-solved each one myself (15 by running or simulating, 0 by reasoning only); the book's key is shown next to my answer. All PYQs
Consider the Boolean expression F(P, Q) = (P̅ + Q) ⊕(P̅Q). Which of the following expressions is equivalent to F?
- (a)P⊕Q
- (b)P⊕Q
- (c)P ̅ ⊕Q
- (d)P ̅ ⊕Q ̅
Which one of the following options is not a property of Boolean Algebra?
- (a)a + b = b + a
- (b)a · a' = 1
- (c)a + a' = 1
- (d)a · b = b · a
Which of the following Boolean algebraic equation(s) is/are CORRECT?
- (a)A ̅BC+ AB ̅C ̅ + A ̅B ̅C ̅ + AB ̅C+ ABC= BC+ B ̅C ̅ + A ̅B ̅
- (b)AB+ A ̅C+ BC= AB+ A ̅C
- (c)(A+ C)(A ̅ + B) = AB+ A ̅C
- (d)(A+ B ̅ + D ̅ )(C+ D)(A ̅ + C+ D)(A+ B+ D ̅ ) = A ̅D+ C ̅D ̅
Let X be a 3-variable Boolean function that produces output as '1' when at least two of the input variables are '1'. Which of the following statement(s) is/are CORRECT, where a, b, c, d, e are Boolean variables?
- (a)X(a, b, X(c, d, e)) = X(X(a, b, c), d, e)
- (b)X(a, b, X(a, b, c)) = X(a, b, c)
- (c)X(a, b, X(a, c, d)) = (X(a, b, a) AND X(c, d, c))
- (d)X(a, b, c) = X(a, X(a, b, c), X(a, c, c))
For a Boolean variable x, which of the following statements is/are FALSE?
- (a)x · 1 = x
- (b)x + 1 = x
- (c)x · x = 0
- (d)x + x̅ = 1 DIGITAL LOGIC
Consider the following Boolean expression. F = (X + Y + Z)(X̅ + Y)(Y̅ + Z) Which of the following Boolean expressions is/are equivalent to F̅ (complement of F)?
- (a)(X̅ + Y̅ + Z̅)(X + Y̅)(Y + Z̅)
- (b)XY̅ + Z̅
- (c)(X + Z̅)(Y̅ + Z̅)
- (d)XY̅ + YZ̅ + X̅Y̅Z̅
Which one of the following is NOT a valid identity?
- (a)(x ⊕ y) ⊕ z = x ⊕ (y ⊕ z)
- (b)(x + y) ⊕ z = x ⊕ (y + z)
- (c)x ⊕ y = x + y, if xy = 0
- (d)x ⊕ y = (xy + x'y')'
Let ⊕ and ⊙ denote the Exclusive OR and Exclusive NOR operations, respectively. Which one of the following is NOT CORRECT?
- (a)(P ⊕ Q)̅̅̅̅̅̅̅̅̅̅̅̅ = P ⊙ Q
- (b)P̅ ⊕ Q = P ⊙ Q
- (c)P̅ ⊕ Q̅ = P ⊕ Q
- (d)P ⊕ P̅ ⊕ Q = (P ⊙ P̅ ⊙ Q̅)
If w, x, y, z are Boolean variables, then which one of the following is INCORRECT?
- (a)wx + w(x + y) + x(x + y) = x + wy
- (b)(wx̄(y + z̄))' + w̄x = w̄ + x + ȳz
- (c)(wx̄(y + xz̄) + w̄x̄)y = xȳ
- (d)(w + y)(wxy + wyz) = wxy + wyz
Let, x1 ⊕ x2 ⊕ x3 ⊕ x4 = 0 where x1, x2, x3, x4 are Boolean variables, and ⊕ is the XOR operator. Which one of the following must always be TRUE?
- (a)x1x2x3x4 = 0
- (b)x1x3 + x2 = 0
- (c)x ̅1 ⊕x ̅3 = x ̅2 ⊕x ̅4
- (d)x1 + x2 + x3 + x4 = 0
Consider the Boolean operator # with the following
properties:
x # 0 = x
x # 1 = x̅
x # x = 0
x # x̅ = 1
Then x # y is equivalent to- (a)xȳ + x̅y
- (b)xȳ + x̅ȳ
- (c)x̅y + xy
- (d)xy + x̅ y̅ DIGITAL LOGIC
Let ⊕ denote the exclusive OR (XOR) operation. Let '1' and '0' denote the binary constants. Consider the following Boolean expression for F over two variables P and Q: F(P, Q) = ((1 ⊕ P) ⊕ (P ⊕ Q)) ⊕ ((P ⊕ Q) ⊕ (Q ⊕ 0)) The equivalent expression for F is
- (a)P + Q
- (b)(P + Q)̅̅̅̅̅̅̅̅̅̅̅̅
- (c)P ⊕ Q
- (d)(P ⊕ Q)̅̅̅̅̅̅̅̅̅̅̅̅
If P, Q, R are Boolean variables, then (P + Q̅)(P·Q̅ + P·R)(P̅·R + Q̅) simplifies to
- (a)P·Q̅
- (b)P·R
- (c)P·Q̅ + R
- (d)P·R̅ + Q
Define the connective * for the Boolean variables X
and Y as:
X * Y = XY + X'Y'.
Let Z = X * Y. Consider the following expressions
P, Q and R.
P: X = Y * Z,
Q: Y = X * Z,
R: X * Y * Z = 1
Which of the following is TRUE?- (a)Only P and Q are valid.
- (b)Only Q and R are valid.
- (c)Only P and R are valid.
- (d)All P, Q, R are valid.
Which of the following expressions is equivalent to (A ⊕ B) ⊕ C ?
- (a)(A + B + C)(A̅ + B̅ + C̅)
- (b)(A + B + C)(A̅ + B̅ + C)
- (c)ABC + A̅(B ⊕ C) + B̅(A ⊕ C)
- (d)None of these
Self-check
Question 1
Simplify .
Show answerHide
(combining). Then by . So .
Question 2
What is the dual of ?
Show answerHide
Swap and and swap 0 with 1, keeping literals: .
Question 3
How many Boolean functions of 4 variables are self-dual?
Show answerHide
.
Question 4
Is true?
Show answerHide
Yes: on both sides are 0; on and both are 1; on the left is and the right is 1. This is the identity .
Revision card
One-screen revision
- Two expressions are equal iff their truth tables are equal. functions of variables.
- Absorption ; ; combining ; consensus term can be deleted.
- De Morgan: swap AND and OR, complement each literal. Dual: swap AND and OR (and 0, 1), literals unchanged.
- .
- XOR is odd parity; ; ; AND distributes over XOR, OR does not.
- No cancellation from alone.
- Precedence NOT, AND, OR.
References
- ·Mano and Ciletti, Digital Design, 5th ed., Chapter 2 Boolean Algebra and Logic Gates (postulates, theorems, Boolean functions, canonical forms)
- ·Kohavi and Jha, Switching and Finite Automata Theory, Boolean algebra and switching functions
Verification
Every identity, the duality statements, the counts of functions (including the self-dual counts) and every worked-example simplification are checked over all truth-table assignments in scripts/enum-checks/dl_boolean.py. The C program is compiled and run by npm run verify:c. The textbook chapter titles are from memory and not checked against the books. The four truth-table animations are computed by scripts/gen-dl-traces.py and checked in tests/dl-traces.test.ts. The independent second pass has not been run yet, so the page stays draft. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (conversions, signed ranges and flags, IEEE 754 fields and custom formats, Boolean identities and counts, K-map groups, adder carries, BCD correction, flip-flop conversions, counter sequences and T equations, state reduction, Quine-McCluskey rounds and covers, floating-point alignment and rounding); long C programs were not re-read line by line (they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose); tables and animations are machine output and were read, not re-run; No other defect found. Status raised to self-checked; verified needs a textbook or human check.
last verified: never
My notes (saved in this browser)