Exercises — Universal gates (NAND - NOR completeness)
Notation reminder (nothing new before it is named):
- means NOT (flip 0↔1).
- or means AND (1 only when both are 1).
- means OR (1 when at least one is 1).
- is NAND; is NOR.
- is XOR (1 when the two inputs differ).
See Truth Tables for the verification method and De Morgan's Laws for the identity we lean on constantly.
Level 1 — Recognition
L1.1
State the output formula of a NAND gate and of a NOR gate, and say for which single input row each one behaves differently from the other.
Recall Solution
, . Build both tiny truth tables:
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| They agree only on the two extreme rows (, ) and disagree on both mixed rows ( and ). NAND stays 1 there; NOR drops to 0. |
L1.2
A student ties both inputs of a NAND gate to the same wire . What single gate did they just build? Show the algebra.
Recall Solution
. Since (a switch AND-ed with itself is itself — idempotence), this is . They built a NOT gate (inverter) from one NAND.
L1.3
Which of these gate sets are functionally complete? (a) (b) (c) (d) . Give the one-line reason for each.
Recall Solution
- (a) Complete — NAND alone makes NOT, AND, OR.
- (b) Not complete — AND can never invert; feed all-1s and you can only ever get 1 out, so no NOT.
- (c) Complete — NOR is the dual universal gate.
- (d) Not complete — both AND and OR are monotonic (raising an input never lowers the output), so no NOT is reachable. You need at least one inverting operation.
Level 2 — Application
L2.1
Build , then use it to build using only NAND. Give the gate count.
Recall Solution
- Inverter: (1 gate) — not actually needed for AND but shows the tool.
- NAND the inputs: (1 gate).
- Invert that result with a NAND-inverter: (1 gate). AND from NAND = 2 NANDs. Follow the wiring in the figure below.

L2.2
Build using only NAND. Show which identity you used and the gate count.
Recall Solution
Use De Morgan: . The right side is a NAND of the two inverted inputs.
- (1 gate).
- (1 gate).
- (1 gate). OR from NAND = 3 NANDs. See the figure.

L2.3
Build using only NOR. Compare its gate count to the NAND version of L2.2.
Recall Solution
NOR's native operation is OR-then-invert, so OR is cheap here: OR from NOR = 2 NORs, versus 3 NANDs in L2.2. This is the duality mirror: what costs 3 gates on one side costs 2 on the other.
L2.4
Verify by full truth table that equals .
Recall Solution
Let , , then output .
| 0 | 0 | 1 | 1 | 0 | |
| 0 | 1 | 1 | 0 | 1 | |
| 1 | 0 | 0 | 1 | 1 | |
| 1 | 1 | 0 | 0 | 1 | |
| Both columns match on every row. ✓ |
Level 3 — Analysis
L3.1
Prove that AND is not functionally complete by a monotonicity argument (no truth-table enumeration of all functions needed).
Recall Solution
Definition (monotone): a function is monotone if changing any input can only keep the output the same or raise it — never lower it. AND is monotone: raising an input can only help both inputs be 1. Key fact: any circuit built purely from monotone gates is itself monotone (composition of monotone maps stays monotone). NOT is not monotone: input sends output — it drops. Therefore no all-AND circuit can ever realise NOT. A gate set that cannot make NOT cannot make , so it is not complete. ∎
L3.2
Count the minimum NAND gates to build a 3-input AND, , and justify the wiring.
Recall Solution
A single NAND with three inputs gives . Invert it: That is 1 three-input NAND + 1 inverter (NAND) = 2 NANDs, same count as 2-input AND, because the extra input rides along inside the one NAND. If only 2-input NANDs are allowed: needs its invert to give (2 gates), then AND with needs 2 more → 4 two-input NANDs.
L3.3
The parent's XOR circuit uses these 4 NANDs: . Show algebraically that , naming every identity used.
Recall Solution
Step 1: . By De Morgan, . Step 2: . Distribute: . Since (a thing AND its opposite is never both true), this is . Step 3: symmetrically . Step 4: . By De Morgan (double form) , which is exactly the definition of . ∎
Level 4 — Synthesis
L4.1
Design (equivalently "if then ", the implication ) using only NAND, minimise gate count.
Recall Solution
Rewrite with De Morgan: .
- (1 gate).
- (1 gate). Total: 2 NANDs. Neat — implication is one inverter plus one NAND. Check the row that should be the only 0: implication is false only when . There , . ✓
L4.2
Design a 2-to-1 multiplexer (output when select , output when ) using only NAND. State the gate count.
Recall Solution
This is the classic 4-NAND MUX (a combinational building block):
- (1 gate).
- (1 gate).
- (1 gate).
- . By De Morgan (1 gate). Total: 4 NANDs. Verify the two behaviours: ; . ✓
L4.3
Build the same 2-to-1 MUX using only NOR. Predict whether it needs more, fewer, or equal gates than the NAND version, then confirm.
Recall Solution
NOR's cheap op is OR, and this expression is a sum (OR) of two AND-terms, so we expect NOR to do reasonably. Rewrite each product as a NOR-of-inverses (De Morgan): … working it purely in NOR:
- ? — no, NOR self-invert: (1).
- (1), (1).
- term1 — since (1 NOR).
- term2 (1 NOR).
- OR the two terms with a NOR-OR: (2 NORs). Counting: (1), (1), reused, term1(1), term2 needs (1)+combine(1), final OR(2) → 6 NORs — more than the 4-NAND version here, because this specific expression is written as a sum-of-products (NAND-friendly). The mirror advantage flips when the target is a product-of-sums.
Level 5 — Mastery
L5.1
Prove that is functionally complete, or prove it is not. (Hint: think NOT.)
Recall Solution
It IS complete.
- NOT: (XOR with a constant 1 flips the bit — check: , ). So with a constant-1 line, XOR gives us NOT.
- AND: given directly.
- OR: from NOT + AND via De Morgan, . We recovered NOT, AND, OR ⇒ is complete (this set with constant 1 is the Reed–Muller basis, the algebra of ). Note the necessity of a constant: pure XOR alone (no constant, no AND) is not complete because XOR-only circuits are linear/affine.
L5.2
A single NAND has propagation delay . For the 4-NAND XOR of L3.3, what is the worst-case delay from a stable input to a stable output (longest chain of gates a signal must pass through)?
Recall Solution
Trace the longest path. is level 1. and each depend on → level 2. depends on → level 3. The critical path is (or ), which is 3 gates deep. Worst-case delay . (A direct input like into into is only 2 levels, so it's not critical.)
L5.3
You are told a mystery 2-input gate satisfies , , and is universal on its own. Only two 2-input gates have this pair of corner values and are single-gate universal. Identify both and give the deciding truth-table row that separates them.
Recall Solution
Corner values and are shared by exactly NAND and NOR (both output 1 on all-0 and 0 on all-1; both are the only single-gate universals). They are separated by the mixed rows:
- NAND: .
- NOR: . So the deciding row is any mixed input, e.g. : 1 ⇒ NAND, 0 ⇒ NOR. These are the only two universal 2-input gates — consistent with the parent claim that NAND and NOR are the universal gates.
Recall One-line self-test (reveal after attempting all)
Cheapest gate for a sum-of-products target ::: NAND (native matches AND-terms). Cheapest gate for a product-of-sums target ::: NOR (native matches OR-terms). Delay of the 4-NAND XOR ::: (three gate levels). Deciding row between NAND and NOR ::: any mixed input like — NAND gives 1, NOR gives 0.
Connections
- Parent: Universal gates
- De Morgan's Laws — powers every OR↔AND conversion above
- Truth Tables — the verification tool used in L1, L2.4
- Duality Principle — explains the NAND/NOR gate-count mirror (L2.3, L4.3)
- Combinational Circuits — the MUX of L4.2 is a real building block
- CMOS Transistors — why NAND/NOR are cheapest to fabricate
- Logic Gate Symbols
- Boolean Algebra & Logic Gates