Chip Architecture
0%
Logic gates from transistors
How pairs of n-type and p-type transistors make NOT, NAND and NOR gates, and why NAND alone can build any circuit.
Before this: CMOS
Explanation
Beginner
A logic gate takes inputs that are 0 or 1 and produces an output that is 0 or 1. A NOT gate flips its input; a NAND gate outputs 0 only when all of its inputs are 1.
Inside the chip, each gate is made from a few transistors acting as switches. One group of switches connects the output to the supply voltage (a 1), the other connects it to ground (a 0).
With enough NAND gates you can build any digital circuit at all, including adders and memory.
Intermediate
In CMOS, p-channel transistors form the pull-up network to VDD and n-channel transistors form the pull-down network to ground. For a NAND, the nMOS devices are in series and the pMOS devices in parallel; for a NOR it is the reverse.
Because one network is always off in a steady state, a CMOS gate draws almost no static current; power is spent mainly when outputs switch (dynamic power ≈ α·C·V²·f).
CMOS gates are naturally inverting: the cheapest gates are NOT, NAND and NOR. AND and OR need an extra inverter stage.
Advanced
Series transistors add resistance, so a series stack is sized wider to match the drive of a single device. Because hole mobility is lower than electron mobility, pMOS devices are typically sized larger than nMOS for equal drive, which is one reason NAND is preferred over NOR in standard-cell libraries.
Logical effort gives a compact delay model: d = g·h + p, where g is the gate's logical effort (NAND2 = 4/3, NOR2 = 5/3 for a 2:1 p/n mobility ratio), h the electrical fan-out and p the parasitic delay (Weste and Harris).
NAND and NOR are functionally complete: any Boolean function can be built from either alone. Synthesis tools map logic onto a library of optimised cells rather than NAND only.
Build the NAND truth table
Flip the inputs and watch which transistors conduct.
Try this: Try all four input combinations. When is the output 0, and which transistors are on then?
Open the Logic gate builder →Make other gates from NAND
A circuit made only of NAND gates.
Try this: Work out which gate this all-NAND circuit behaves like.
- Toggle the input switches.
- Write down the lamp's output for each combination.
- Compare it with the truth tables of NOT, AND and OR.
Check your understanding
A quick self-check. Nothing is recorded.
Key terms
Key takeaways
- CMOS gates use a pMOS pull-up network and an nMOS pull-down network that are never on together.
- NAND puts nMOS in series and pMOS in parallel; NOR is the opposite.
- NAND alone can build any logic, which is why it is called universal.
Quiz · 5 questions
Chip architecture check →
Packages, cores, caches and gates.
References
- N. H. E. Weste and D. M. Harris, CMOS VLSI Design: A Circuits and Systems Perspective, 4th ed. (Addison-Wesley, 2011)
- J. M. Rabaey, A. Chandrakasan and B. Nikolić, Digital Integrated Circuits: A Design Perspective, 2nd ed. (Prentice Hall, 2003)
The 3D models and simulations are simplified teaching aids. Proportions, colours and some thicknesses are not to scale; each lab says what it simplifies.
My notes
Private to you. They also appear on your dashboard.
Continue learning
Logic gates from transistors
Up next
Logic
Chip Architecture
The Boolean gates and flip-flops that implement digital functions.
Continue learning →