Question
List all basic logic gates with their truth tables and Boolean expressions. Why are NAND and NOR called universal gates? How can you construct AND, OR, and NOT gates using only NAND gates?
(CBSE 12 boards ask truth tables for 3-5 marks; JEE Main tests universal gate construction)
Solution — Step by Step
AND gate: Output is 1 only when ALL inputs are 1.
OR gate: Output is 1 when ANY input is 1.
NOT gate (Inverter): Output is the complement of input.
NAND gate: AND followed by NOT. Output is 0 only when ALL inputs are 1.
NOR gate: OR followed by NOT. Output is 1 only when ALL inputs are 0.
XOR gate: Output is 1 when inputs are DIFFERENT.
A gate is called universal if you can build ALL other gates using only that gate. Both NAND and NOR have this property.
Using only NAND gates:
- NOT: Connect both inputs of a NAND to the same signal.
- AND: NAND followed by NOT (another NAND as inverter).
- OR: Invert each input (using NAND as NOT), then NAND them. (De Morgan’s law)
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
flowchart TD
A["NAND Gate<br/>(Universal)"] --> B["NOT: tie inputs together<br/>NAND(A,A) = NOT A"]
A --> C["AND: NAND + NOT<br/>NOT(NAND(A,B)) = AND"]
A --> D["OR: NOT inputs, then NAND<br/>NAND(NOT A, NOT B) = OR"]
B --> E["All basic gates built<br/>from NAND alone"]
C --> E
D --> E
style A fill:#ffeb3b,stroke:#333
Why This Works
Logic gates are the building blocks of all digital electronics — from calculators to computers. The universality of NAND and NOR means that an entire computer processor can theoretically be built using just one type of gate, which simplifies manufacturing enormously.
De Morgan’s theorems ( and ) are the mathematical foundation for the universal gate constructions. They show that NAND can produce OR-like behaviour and NOR can produce AND-like behaviour when combined with inversion.
Alternative Method
For CBSE boards, the easiest way to verify a truth table is to plug in values. If you forget the Boolean expression for XOR, just check: “output is 1 when inputs are different.” Apply this rule row by row and you will get the correct truth table without memorising the formula.
Common Mistake
Students confuse NAND with NOR truth tables. The easy way to keep them straight: NAND gives 0 only when both inputs are 1 (it is the “NOT-AND”). NOR gives 1 only when both inputs are 0 (it is the “NOT-OR”). NAND is “generous” (mostly outputs 1), NOR is “strict” (mostly outputs 0).