Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksBuild a CPUToolsOpen the lab →

NAND vs NOR: two universal gates, compared

NAND and NOR are the two universal logic gates: each one alone can build every other gate, and so any digital circuit. NAND (NOT AND) outputs 0 only when all its inputs are 1; NOR (NOT OR) outputs 1 only when all its inputs are 0. In CMOS both take four transistors for two inputs, and their transistor networks are exchanged: a NAND has its two PMOS in parallel pulling up and its two NMOS in series pulling down, while a NOR has its PMOS in series and its NMOS in parallel. They are mirror images, but not equally fast: a NOR stacks its slow PMOS transistors in series, while a NAND stacks its faster NMOS.

What each one is good at

Both are universal and both are natural in CMOS, because CMOS gates invert by construction, so AND and OR each need a NAND or NOR plus an inverter. NAND has the speed advantage: series transistors drive more weakly, and in a NAND the series pair is NMOS, the faster type, while a NOR puts the slower PMOS in series and needs them made wider to keep up, which is a common reason to build logic mostly from NANDs. NOR has its own classic use: two cross-coupled NOR gates make an SR latch with active-high inputs, where the NAND version uses active-low inputs.

Build both live in digiwleea

In digiwleea you build both from transistors and check them against their truth tables: the CMOS NAND and the CMOS NOR. Then prove they are universal by building other gates from each, on the NAND universal gates and NOR universal gates pages. The NAND and NOR lessons explain the transistor networks, and the gate truth tables are on the NAND and NOR pages.

Truth tables

ABNANDNOR
0011
0110
1010
1100

CMOS structure

NANDNOR
Pull-up (PMOS)Two in parallelTwo in series
Pull-down (NMOS)Two in seriesTwo in parallel
Output 0 whenAll inputs are 1Any input is 1
Transistors (2 inputs)44

No sign-up is needed to start: open the lab and place your first transistor, or read the free theory course. The account (and the AI tutor) are optional.

More comparisons: Digital logic concepts compared

See for yourself: build a logic gate from transistors in the simulator, then follow the path from sand to an 8-bit CPU.

Open the digiwleea lab →

Frequently asked

What is the difference between NAND and NOR gates?

A NAND gate outputs 0 only when all its inputs are 1; a NOR gate outputs 1 only when all its inputs are 0. NAND is AND followed by NOT, and NOR is OR followed by NOT.

Why are NAND and NOR called universal gates?

Because each one alone can build NOT, AND and OR, and every logic function can be written with those three, so any digital circuit can be made from NAND gates only or from NOR gates only.

Why is NAND preferred over NOR in CMOS?

A 2-input NAND puts its two NMOS transistors in series, while a NOR puts its two PMOS in series. Series transistors drive more weakly and PMOS is already the slower type, so a NOR needs larger PMOS to switch as fast, which makes NAND the more efficient choice.

How many transistors are in a CMOS NAND and NOR gate?

Four each for two inputs, and 2n for n inputs: one NMOS and one PMOS per input.