Skip to content
Semitree

Chip Architecture

0%

C · Chip ArchitectureWritten lessonDiagramSimulationGuided explorationKnowledge checkQuiz

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

Explain it at
Simple explanations and analogies.

Explanation

Beginner

Think of it like this: A CMOS gate is two sets of doors: one set connects the output to the power supply, the other to ground. The inputs decide which set is open, and the two are never open at the same time.

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.

V_DDGNDPMOSNMOSinout
A CMOS inverter: the pMOS pulls up, the nMOS pulls down.
SimulationLogic gate builder · 2D

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 →
Guided explorationCircuit builder · 2D

Make other gates from NAND

A circuit made only of NAND gates.

Try this: Work out which gate this all-NAND circuit behaves like.

  1. Toggle the input switches.
  2. Write down the lamp's output for each combination.
  3. Compare it with the truth tables of NOT, AND and OR.
Open the Circuit builder →

Check your understanding

A quick self-check. Nothing is recorded.

Question 1

Multiple choice

In a CMOS NAND gate, how are the nMOS transistors connected?

Question 2

True or false

Any digital circuit can be built from NAND gates alone.

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

  1. N. H. E. Weste and D. M. Harris, CMOS VLSI Design: A Circuits and Systems Perspective, 4th ed. (Addison-Wesley, 2011)
  2. 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 →