Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

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.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

What you need

Step by step

  1. Place inputs A and B.
  2. NOT: tie both inputs of a NOR to A. NOR(A, A) = NOT A.
  3. OR: NOR A with B to get M = NOR(A, B), then invert M with a tied-input NOR.
  4. AND: invert B the same way and NOR the two inverted inputs: NOR(NOT A, NOT B) = A AND B.
  5. 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, AND and XOR.

Truth table of every output

ABNOT AA OR BA AND BA XOR B
001000
011101
100101
110110

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.