The Light Switch Analogy
Imagine each logic gate as a combination of water pipes or light switches:
AND gate is like two switches in series: Water (current) only flows if switch A AND switch B are BOTH ON. If either is OFF, the circuit breaks.
OR gate is like two switches in parallel: Water flows if switch A OR switch B is ON. Only when BOTH are off does water stop.
NOT gate is an inverter: When the switch is pressed (input = 1), the light turns OFF (output = 0). It does the opposite.
NAND gate = AND + NOT: Both switches ON → light OFF. Everything else → light ON. (The "stubborn gate" — hard to turn off)
NOR gate = OR + NOT: Both switches OFF → light ON. Anything else → light OFF. (The "all-or-nothing gate" — very sensitive)
Why Universal Gates Matter
Think of a universal gate as a "Swiss Army knife" of logic. Just as you can make any tool from raw metal, you can make ANY logic circuit from ONLY NAND gates. Computer chips in the 1970s–80s were literally just millions of NAND gates arranged cleverly.
Making NOT from NAND: Connect both inputs together → behaves as NOT.
- Input 0,0 → NAND gives 1 (NOT 0) ✓
- Input 1,1 → NAND gives 0 (NOT 1) ✓
Making AND from NAND: NAND followed by NOT(NAND) = (NAND)' = AND.
The Core Insight
Boolean algebra is just arithmetic with two values. '+' means OR, '·' means AND, and the bar/apostrophe means NOT. De Morgan showed us they're deeply symmetric: swapping AND↔OR and flipping all values gives an equivalent expression.