Boolean functions and gates
A truth table is the final test of a Boolean identity. Use algebra to shorten a function, then distinguish its logic from the particular gates used to implement it.
1.1 Gates and identities
Past papers · CS 2014–2026 (23 papers): 4 questions, 4 marks · EC 2020–2026 (7 papers): 1 question, 1 mark
A Boolean variable takes only 0 or 1. NOT has highest precedence, then AND, then OR. Parenthesise XOR when mixing operators.
| AND | OR | NAND | NOR | XOR | XNOR | |
|---|---|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 1 | 0 | 1 |
| 01 | 0 | 1 | 1 | 0 | 1 | 0 |
| 10 | 0 | 1 | 1 | 0 | 1 | 0 |
| 11 | 1 | 1 | 0 | 0 | 0 | 1 |
A bubble denotes inversion at that pin. Moving a bubble through a gate changes AND to OR, or OR to AND, and complements every pin. A NAND is not associative: preserve intermediate connections when translating a circuit.
1.2 Canonical forms and truth sets
Past papers · CS 2014–2026 (23 papers): 5 questions, 9 marks
A literal is a variable or its complement. A product term is an AND of literals; a sum term is an OR. A minterm contains every variable and is 1 on exactly one row; a maxterm contains every variable and is 0 on exactly one row.
Sum of products (SOP) need not be canonical; product of sums (POS) need not be canonical. To expand a missing variable, use in SOP or in POS.
Truth-set operations are useful for multi-output circuit questions: AND takes intersection, OR takes union, NOT takes the complement in the full row universe, and XOR takes symmetric difference. A product term with distinct literals in variables covers rows. Count the union when terms overlap.
1.3 XOR, parity and majority
Past papers · CS 2014–2026 (23 papers): 8 questions, 10 marks · EC 2020–2026 (7 papers): 1 question, 1 mark
Hamming codes and CRC: see Computer Networks (CS) and Communications (EC).
XOR gives 1 for an odd number of input ones. The complement of an -input XOR gives even parity; it is not an “all inputs equal” detector when .
An XOR parity check detects any odd number of bit flips, but misses every even number. A cascade of two-input XNOR gates is not always the complement of a multiple-input XOR: replacing each XOR by XNOR adds one XOR-with-1 for each gate.
1.4 Duality and function counts
Past papers · CS 2014–2026 (23 papers): 1 question, 1 mark
The dual interchanges AND with OR and 0 with 1, leaving literals as written. Complementation additionally complements literals through De Morgan's law. Duality preserves valid identities.
1.5 Universal gates and functional completeness
Past papers · CS 2014–2026 (23 papers): 3 questions, 5 marks · EC 2020–2026 (7 papers): 1 question, 2 marks
A gate family is functionally complete if it can realise every Boolean function. State whether constants 0 and 1 are available. Repeated inputs and feedback-free gate composition are allowed; arbitrary feedback is not part of a combinational construction.
For an unfamiliar gate, tie inputs together or to permitted constants to obtain NOT and either AND or OR. To prove incompleteness, identify an invariant: gates preserving 0 cannot generate a nonzero output on all-zero inputs without a 1 source; similarly for preserving 1. Monotone gates cannot generate NOT. XOR/XNOR/NOT/constants generate only affine XOR expressions, not AND. Self-dual gates alone remain self-dual. For a complete general test, a family must not lie wholly in any one of these five classes: 0-preserving, 1-preserving, monotone, affine, self-dual. Include available constants in that test. Functional-completeness reference.
A minimum SOP does not necessarily minimise two-input gate count. Factor common terms, share inverters, note which complemented inputs are free, and count each physical gate once. Two-level NAND–NAND realises SOP; NOR–NOR realises POS.
Last-minute recall
- Use the truth table when an unfamiliar operator is defined.
- NAND and NOR are commutative, but not associative.
- Minterm and maxterm bit polarities are opposite.
- XOR cancels a repeated input; OR does not.
- Duality is different from complementation.
- Self-duality constrains complementary row pairs.
- Gate-count questions depend on fan-in and available complements.