← 🧮 Boolean Algebra, Canonical Forms & K-Maps
Subtopic 4 of 5

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

  1. NOT is a NAND with its inputs tied together.
  2. AND = NOT of NAND; OR = NAND of the inverted inputs (De Morgan).
  3. XOR needs 4 NAND gates (t = NAND(A,B), then NAND(NAND(A,t), NAND(B,t))).
  4. 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.
t = NAND(A, B) p = NAND(A, t) q = NAND(B, t) y = NAND(p, q)
ABXOR (target)our circuit
0000
0111
1011
1100
NAND gates needed4
Matches the targetyes

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.

GateNAND-only gatesNOR-only gates
NOT11
AND23
OR32
XOR45
NOR4-
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

Remember: NAND and NOR are each functionally complete; XOR costs 4 NANDs or 5 NORs.
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.