XOR gate using NOR gates: five gates, live
An XOR gate can be built from five NOR gates: four of them make XNOR, and the fifth, with both inputs tied together, inverts it into A XOR B. NOR gates naturally give XNOR, the mirror image of how four NAND gates give XOR.
The four-gate core is the dual of the XOR from four NAND gates: N1 = NOR(A, B), then N2 = NOR(A, N1) and N3 = NOR(B, N1), and NOR(N2, N3) is A XNOR B. Expanding shows why: N2 = NOT A AND B and N3 = A AND NOT B, the two cases where the inputs differ, so NORing them gives 1 exactly when A and B are equal. A fifth NOR used as an inverter turns that into XOR. So with NOR gates, XNOR costs four gates and XOR five, while with NAND gates it is the other way round. The same five gates, with N2 as the borrow, are the half subtractor from NOR gates; see also NOT, OR and AND from NOR gates.
Open this circuit in the lab →
What you need
- 4× NOR: A XNOR B: N1 = NOR(A, B), N2 = NOR(A, N1), N3 = NOR(B, N1), XNOR = NOR(N2, N3)
- 1× NOR: Y = NOR(XNOR, XNOR) = A XOR B
Step by step
- Place inputs
AandBand a probeY. - N1 = NOR(A, B). Then N2 = NOR(A, N1) and N3 = NOR(B, N1).
- NOR N2 with N3: that output is A XNOR B.
- Feed the XNOR into both inputs of a fifth NOR: its output is
Y= A XOR B. - Try all four rows: Y is 1 only when A and B differ.
XOR from NOR truth table
| A | B | N1 | N2 | N3 | XNOR | Y |
|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 |
N2 and N3 each catch one of the two rows where the inputs differ. All four rows are checked on the live circuit before the page is built.
You can also read the full theory in the lesson on NOR as a universal gate. 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 XOR gate from NOR gates in the lab →Frequently asked
How many NOR gates are needed to make an XOR gate?
Five: four NOR gates make XNOR, and a fifth inverts it into XOR.
How many NOR gates make an XNOR gate?
Four. N1 = NOR(A, B), N2 = NOR(A, N1), N3 = NOR(B, N1), and NOR(N2, N3) is A XNOR B.
Why does XOR take more NOR gates than NAND gates?
The four-gate NAND network computes XOR and its NOR dual computes XNOR. So NAND gets XOR in four gates, while NOR needs a fifth gate to invert its XNOR.