Universal gates: NOT, OR, AND and XOR from NOR only
NOR is a universal gate too: NOT A = NOR(A, A), A OR B = NOT NOR(A, B), A AND B = NOR(NOT A, NOT B), and XOR takes five NOR gates. This circuit builds all four from nine NOR gates.
NOR is the mirror image of NAND. Tying its inputs together makes an inverter, inverting a NOR gives OR, and by De Morgan's law NORing the two inverted inputs gives AND. XOR is the longest: one NOR makes NOR(A, B), two more pick out the cases A'B and AB', a fourth NORs those into XNOR, and a fifth inverts it to XOR. Toggle A and B in the live circuit and watch all four outputs follow their truth tables.
Open this circuit in the lab →
What you need
- 1× NOR: NOT A: both inputs tied to A
- 2× NOR: A OR B: NOR(A, B), then a NOR used as an inverter
- 2× NOR: A AND B: NOT B from a second inverter, then NOR(NOT A, NOT B)
- 4× NOR: A XOR B: NOR(A, NOR(A,B)) and NOR(B, NOR(A,B)), NORed into XNOR, then inverted (sharing NOR(A,B))
Step by step
- Place inputs
AandB. - NOT: tie both inputs of a
NORto A. NOR(A, A) = NOT A. - OR: NOR A with B to get
M = NOR(A, B), then invert M with a tied-input NOR. - AND: invert B the same way and NOR the two inverted inputs: NOR(NOT A, NOT B) = A AND B.
- XOR: NOR A with M and B with M. These are A'B and AB'. NOR those two to get XNOR, then invert it. Probe
NOT,OR,ANDandXOR.
Truth table of every output
| A | B | NOT A | A OR B | A AND B | A XOR B |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 | 0 |
Gate counts with NOR only: NOT 1, OR 2, AND 3, XNOR 4 and XOR 5. They mirror the NAND counts with AND and OR swapped, because De Morgan's law swaps them. NAND is usually preferred in CMOS because its series transistors are the fast NMOS ones, but NOR works just as completely, as the classic Apollo Guidance Computer showed: it was built almost entirely from 3-input NOR gates.
You can also read the full theory in the lesson on NOR is universal too. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
Build more parts from gates
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the NOT, OR, AND and XOR from NOR in the lab →Frequently asked
Why is NOR a universal gate?
NOT, OR and AND can all be made from NOR gates alone, and those three can express any Boolean function, so NOR by itself can build any digital circuit.
How do you make an XOR gate using NOR gates?
Five NOR gates: M = NOR(A, B); P = NOR(A, M) = A'B; Q = NOR(B, M) = AB'; NOR(P, Q) = XNOR; and a fifth NOR with tied inputs inverts that to XOR.
How do you make an AND gate using NOR gates?
Invert each input with a tied-input NOR, then NOR the two inverted signals: NOR(NOT A, NOT B) = A AND B by De Morgan's law. That takes three NOR gates.
What is the difference between NAND and NOR as universal gates?
Both are functionally complete. With NAND, AND takes 2 gates and OR takes 3; with NOR it is the other way round. In CMOS, NAND gates are usually smaller and faster, so they are more common.