Universal & Arithmetic Gates
NAND and NOR are universal gates — any circuit can be built from just one type. XOR and XNOR are arithmetic gates used in adders and comparators.
NAND = NOT AND · NOR = NOT OR · XOR = Exclusive OR (inputs must differ) · XNOR = Exclusive NOR (inputs must be equal)
NAND Gate
Truth Table
| A | B | Y = A NAND B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOR Gate
Truth Table
| A | B | Y = A NOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR Gate
Truth Table
| A | B | Y = A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XNOR Gate
Truth Table
| A | B | Y = A XNOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Why NAND is Universal
You can implement NOT, AND, and OR gates using only NAND gates. This means any digital circuit can be built from NAND alone — which is why it's heavily used in CMOS chip fabrication.
Why NOR is Universal
Same principle — NOR can implement NOT, AND, and OR. The original Apollo Guidance Computer was built entirely from NOR gates.
XOR as Equality Detector
XOR outputs 1 when inputs are different. XNOR is its complement — outputting 1 when inputs are equal. XNOR is therefore also called an equality gate and is the core of comparator circuits.