Simplify Y = A'BC + AB'C + ABC' + ABC algebraically.
Boolean algebra is the two-valued algebra of AND, OR and NOT that describes every digital circuit. Its postulates and theorems (De Morgan, absorption, consensus, duality) simplify expressions; gates, universal NAND/NOR and canonical SOP/POS forms turn those expressions into hardware.
Boolean algebra works with just two values, 0 and 1 — false/true, low/high voltage, open/closed switch. A Boolean variable (A, B, x, …) holds one of them, and a literal is a variable or its complement (A or A'). There are three basic operations: AND (written ·, or by juxtaposition AB, called a product), OR (written +, called a sum) and NOT (written A' or A̅, the complement).
| A | B | A·B (AND) | A + B (OR) | A' (NOT A) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Precedence is: parentheses, then NOT, then AND, then OR — so A + BC' means A + (B·(C')). A bar over a whole expression groups like parentheses. Note that 1 + 1 = 1 here (OR, not arithmetic addition): Boolean algebra has no carries, and no subtraction or division.
George Boole introduced the algebra of logic in The Laws of Thought (1854). Edward Huntington gave it a formal set of postulates in 1904, and Claude Shannon showed in 1938 that relay and switch circuits obey exactly these rules (series = AND, parallel = OR), founding switching theory — the design method for every digital circuit since.
A truth table lists the output for every combination of inputs: n inputs give 2ⁿ rows. Two expressions are equal exactly when their truth-table columns match, and checking all rows is called proof by perfect induction. Try any expression in the Truth-table builder tool on this page: it prints the table and tests two expressions for equivalence.
Huntington's postulates are the axioms of Boolean algebra; everything else is a theorem proved from them. Each postulate and theorem comes as a pair of duals — one in OR form and one in AND form — which halves the work of remembering them.
| Postulate | Form (a) | Dual form (b) |
|---|---|---|
| P1 Closure | A + B is 0 or 1 | A·B is 0 or 1 |
| P2 Identity elements | A + 0 = A | A·1 = A |
| P3 Commutative | A + B = B + A | A·B = B·A |
| P4 Distributive | A·(B + C) = AB + AC | A + BC = (A + B)(A + C) |
| P5 Complement | A + A' = 1 | A·A' = 0 |
| P6 Two elements | At least two distinct elements exist: 0 ≠ 1 | — |
| Theorem | Form (a) | Dual form (b) |
|---|---|---|
| T1 Null (domination) | A + 1 = 1 | A·0 = 0 |
| T2 Idempotent | A + A = A | A·A = A |
| T3 Involution | (A')' = A | — |
| T4 Associative | A + (B + C) = (A + B) + C | A(BC) = (AB)C |
| T5 Absorption | A + AB = A | A(A + B) = A |
| T6 Redundant literal | A + A'B = A + B | A(A' + B) = AB |
| T7 De Morgan | (A + B)' = A'B' | (AB)' = A' + B' |
| T8 Consensus | AB + A'C + BC = AB + A'C | (A + B)(A' + C)(B + C) = (A + B)(A' + C) |
| T9 Combining (adjacency) | AB + AB' = A | (A + B)(A + B') = A |
The consensus term BC is redundant because whenever B = C = 1, either A = 1 (so AB is already 1) or A = 0 (so A'C is already 1). The consensus of two terms is formed by deleting the one variable that appears true in one term and complemented in the other: the consensus of AB and A'C is B·C.
The dual of an expression is formed by interchanging + and ·, and 0 and 1, while leaving every variable and complement as it is. The duality principle says that if an identity is true, its dual is also true — because the postulates themselves come in dual pairs. So proving one half of each theorem proves the other half for free.
De Morgan's theorems, (A + B)' = A'B' and (AB)' = A' + B', extend to any number of variables: (A + B + C + …)' = A'B'C'… and (ABC…)' = A' + B' + C' + …. The memory rule is break the bar, change the sign. Applied to a whole expression, they give a mechanical way to complement any function.
There are two ways to prove a Boolean identity. Algebraic manipulation applies the postulates and theorems step by step; it gives insight and short forms. Perfect induction compares truth tables row by row; it is mechanical and always works, but the table doubles with every extra variable.
| A | B | A + B | (A + B)' | A' | B' | A'·B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
When do you stop? A minimal SOP has the fewest product terms and, among those, the fewest literals. Algebra never tells you that you have reached the minimum — a missed consensus or a better grouping may still exist. That is why the systematic Karnaugh map and Quine–McCluskey methods (next topic) are used for anything beyond a few terms.
A logic gate is a circuit that computes one Boolean operation. The standard symbols are worth recognising: AND is a D shape (flat back, round front); OR has a curved back and a pointed front; NOT is a triangle with a small circle at its tip. That circle, the bubble, always means inversion, so NAND is an AND with a bubbled output and NOR an OR with a bubbled output. XOR is the OR shape with an extra curved line across the inputs, and XNOR adds a bubble.
| Gate | Expression | Output is 1 when | Outputs for AB = 00, 01, 10, 11 | TTL IC (quad 2-input unless noted) |
|---|---|---|---|---|
| AND | A·B | all inputs are 1 | 0 0 0 1 | 7408 |
| OR | A + B | at least one input is 1 | 0 1 1 1 | 7432 |
| NOT | A' | the input is 0 | 1, 0 (for A = 0, 1) | 7404 (hex inverter) |
| NAND | (A·B)' | at least one input is 0 | 1 1 1 0 | 7400 |
| NOR | (A + B)' | all inputs are 0 | 1 0 0 0 | 7402 |
| XOR | A ⊕ B = A'B + AB' | the inputs differ | 0 1 1 0 | 7486 |
| XNOR | (A ⊕ B)' = AB + A'B' | the inputs are equal | 1 0 0 1 | 74266 (open collector) |
De Morgan gives every gate an alternative symbol. Since (AB)' = A' + B', a NAND is the same as an OR with bubbled inputs (negative-OR); since (A + B)' = A'B', a NOR is the same as an AND with bubbled inputs (negative-AND). Designers pick whichever symbol makes the bubbles on a drawing meet in pairs and cancel, so the logic can be read straight off the diagram.
A set of gates is functionally complete if every Boolean function can be built from it. {AND, OR, NOT} is complete, because any truth table can be written as a sum of minterms. A single NAND type is also complete — it can make NOT, AND and OR — and so is a single NOR type. NAND and NOR are therefore called universal gates. Manufacturers favour them because in both TTL and CMOS the NAND/NOR is the simplest and fastest basic gate.
| Function | Using NAND gates only | NANDs | Using NOR gates only | NORs |
|---|---|---|---|---|
| NOT A | (A·A)' — tie both inputs together | 1 | (A + A)' | 1 |
| A·B | NAND followed by a NAND inverter | 2 | (A' + B')' — invert both inputs first | 3 |
| A + B | (A'·B')' — invert both inputs first | 3 | NOR followed by a NOR inverter | 2 |
| (A + B)' | OR network + inverter | 4 | the gate itself | 1 |
| (A·B)' | the gate itself | 1 | AND network + inverter | 4 |
| A ⊕ B | four-gate network (below) | 4 | XNOR network + inverter | 5 |
| A ⊙ B | XOR network + inverter | 5 | four-gate network | 4 |
Two-level circuits convert directly. Any SOP becomes a NAND-NAND network: replace each AND by a NAND and the final OR by a NAND (a double complement — the inner bubbles and the outer bubble cancel by De Morgan). Any POS becomes a NOR-NOR network in the same way. A single literal that feeds the second level directly must be inverted, which is where hidden extra gates come from.
A product term is an AND of literals (AB'C); a sum term is an OR of literals (A + B' + C). A sum of products (SOP) ORs product terms together, e.g. AB + A'C, and maps to AND gates feeding one OR gate. A product of sums (POS) ANDs sum terms, e.g. (A + B)(A' + C), and maps to OR gates feeding one AND gate. Any SOP or POS is a standard form; it is canonical when every term contains every variable exactly once.
A minterm (standard product) contains all n variables and is 1 for exactly one row of the truth table: write a variable plain where its bit is 1 and primed where it is 0. A maxterm (standard sum) contains all n variables and is 0 for exactly one row: here the rule is reversed, plain for 0 and primed for 1. Each is named by the decimal value of its row, mᵢ or Mᵢ.
| A B C | Row i | Minterm mᵢ | Maxterm Mᵢ |
|---|---|---|---|
| 0 0 0 | 0 | A'B'C' | A + B + C |
| 0 0 1 | 1 | A'B'C | A + B + C' |
| 0 1 0 | 2 | A'BC' | A + B' + C |
| 0 1 1 | 3 | A'BC | A + B' + C' |
| 1 0 0 | 4 | AB'C' | A' + B + C |
| 1 0 1 | 5 | AB'C | A' + B + C' |
| 1 1 0 | 6 | ABC' | A' + B' + C |
| 1 1 1 | 7 | ABC | A' + B' + C' |
Reading a function off its truth table is therefore mechanical: the canonical SOP ORs the minterms of the 1-rows, and the canonical POS ANDs the maxterms of the 0-rows. Both describe the same function. Canonical forms are unique, which makes them ideal for comparing two functions, but they are rarely minimal; K-maps shrink them afterwards.
Switching between the two canonical forms needs no algebra at all — just take the complementary index set: Σm(2, 3, 5, 7) = ΠM(0, 1, 4, 6). The complement F' uses the missing indices in the same notation, F' = Σm(0, 1, 4, 6).
How many different functions are there? A function of n variables is fixed by its truth-table column of 2ⁿ entries, each 0 or 1, so there are 2^(2ⁿ) functions: 4 for n = 1, 16 for n = 2, 256 for n = 3 and 65,536 for n = 4. The 16 two-variable functions are the constants 0 and 1; A, B, A', B'; AND, OR, NAND, NOR, XOR, XNOR; and four implication-type functions, AB', A'B, A + B' and A' + B.
Try the problem first, then reveal the working one step at a time.
Simplify Y = A'BC + AB'C + ABC' + ABC algebraically.
Find the minimum number of 2-input NAND gates required to realise F = AB + C'D' when only the uncomplemented inputs A, B, C, D are available.
For F(A, B, C) = A + B'C, find the canonical SOP, the canonical POS, and F' in simplest SOP form.
Simplify F = (A + B' + C)(A + B' + C')(A' + B' + C).
Prove algebraically that (A + B)(A' + C) = AC + A'B.
Find (a) the dual and (b) the complement of F = AB' + C(A' + D).
Express F(A, B, C) = (A + B)(B' + C) in canonical POS and canonical SOP form.
Using only 2-input NOR gates and uncomplemented inputs, realise (a) F = (A + B)·C' and (b) G = (A + B)·C with the fewest gates.
(a) How many rows does the truth table of a 4-variable function have, and how many distinct 4-variable Boolean functions exist? (b) Show that A ⊕ B = (A + B)·(AB)' and describe a 3-gate XOR built from it.
12 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.