2.4Universal gates: NAND and NOR
The idea
Universal gates: NAND alone, or NOR alone, can build every other gate, so a circuit can be made from a single type of gate.
Think of it like this: A kit with one kind of brick: with enough of them you can build anything.
Why it exists
Counting the gates for XOR, converting to NAND-only and "which set is complete" are regular two-mark topics.
How it works
- NOT is a NAND with its inputs tied together.
- AND = NOT of NAND; OR = NAND of the inverted inputs (De Morgan).
- XOR needs 4 NAND gates (t = NAND(A,B), then NAND(NAND(A,t), NAND(B,t))).
- The same ideas with NOR: AND = NOR(A′, B′), OR = NOT of NOR, XOR needs 5.
Worked example: OR using only NAND gates
A + B = (A′B′)′ = NAND(A′, B′), and each inverter is a NAND with tied inputs: 3 NAND gates.
Now play with it
- →Pick NAND and XOR: the netlist uses four gates and the truth table matches.
- →Switch to NOR and see that XOR needs five.
| A | B | XOR (target) | our circuit |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
Each of NAND and NOR alone is functionally complete: NOT is a gate with its inputs tied together, then AND/OR follow from De Morgan.
| Gate | NAND-only gates | NOR-only gates |
|---|---|---|
| NOT | 1 | 1 |
| AND | 2 | 3 |
| OR | 3 | 2 |
| XOR | 4 | 5 |
| NOR | 4 | - |
| NAND | - | 4 |
The NAND count for XOR (4) and the NOR count for XOR (5) are standard exam numbers.
Check yourself
The minimum number of 2-input NAND gates needed to build an XOR gate is
Exam notes (the dense version)
NAND alone (or NOR alone) can build every Boolean function, so each is functionally complete. NAND: NOT = NAND(A, A); AND = NOT(NAND); OR = NAND(A′, B′); XOR needs 4 NAND gates. NOR: NOT = NOR(A, A); OR = NOT(NOR); AND = NOR(A′, B′); XOR needs 5 NOR gates. Convert an SOP expression to NAND-NAND (two levels) and a POS expression to NOR-NOR. AND, OR are associative; NAND and NOR are not associative. XOR is associative and commutative; XNOR = (A ⊕ B)′ = A ⊕ B′.
Previous year questions: Boolean Algebra, Canonical Forms & K-Maps (27)
PYQs are grouped by topic, so this is the full set for Boolean Algebra, Canonical Forms & K-Maps; try the ones that match this subtopic. Open all 27 on the topic page.