TactivergeLite

Lite / Engineering Complex Systems / Week 23

Building gates from switches

A modern chip has billions of transistors and almost all are wired as just three or four patterns. What are they?

About 35 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

CMOS is the reason your phone lasts a day instead of an hour. By pairing two kinds of switch so one network always blocks, it draws power only when it switches. Learning the pattern lets you read a transistor schematic as logic.

Predict

In a CMOS NAND gate, how are the two nMOS transistors in the pull-down network connected?

  1. In parallel
  2. In series
  3. Not at all
  4. Through a resistor
Guess first, then reveal

In series: the output is pulled to 0 only when A AND B are both 1, so both switches must close. The pMOS pull-up is the mirror image: in parallel, so either input being 0 pulls the output to 1.

Discover

Start with the inverter and toggle A. Then switch to NAND and NOR and try all four input combinations. For each, say which network conducts and confirm there is never a path from VDD to ground.

What the interactive shows (text version)

In the gate builder, the inverter's output is 1 when A = 0 (pMOS on) and 0 when A = 1 (nMOS on). The NAND output is 0 only for A = B = 1, when both series nMOS conduct; the NOR output is 1 only for A = B = 0, when both series pMOS conduct. In every case exactly one network conducts.

You can also open the interactive on the full site when you have a faster connection.

Watch (optional)

Watch for: Ben Eater uses bipolar transistors, not MOSFETs, but watch for the same idea: switches in series make AND-like behaviour, in parallel OR-like.

Builds real logic gates from transistors on a breadboard, linking abstract logic to actual electronics.

“Making logic gates from transistors” by Ben Eater (opens YouTube; streaming video uses a lot of data)

The video is optional. Everything you need is in this lesson's text.

Understand

Two kinds of switch

An nMOS conducts when its gate is high (1) and is good at pulling a node down to ground. A pMOS conducts when its gate is low (0) and is good at pulling up to VDD. In the switch-level model each is simply on or off; in reality each has some resistance and capacitance.

Pull-up and pull-down networks

A static CMOS gate has a pull-down network of nMOS between the output and ground and a pull-up network of pMOS between VDD and the output. Series nMOS = AND condition for pulling down; parallel nMOS = OR. The pull-up is the dual: series becomes parallel and vice versa. So NAND = series nMOS + parallel pMOS; NOR = parallel nMOS + series pMOS. Each input drives one of each: a 2-input gate has 4 transistors.

Why it costs so little to sit still

For every input combination exactly one network conducts. So in steady state there is no path from VDD to ground and only tiny leakage flows. Power is spent mainly when the output switches and its load capacitance charges or discharges, which is next lesson's topic.

Explain it another way

Intuitive

Two teams of doors: one between the output and the high rail, one between the output and the low rail. The teams are wired so that when one opens, the other is shut.

Technical

Natural CMOS gates are inverting (NAND, NOR, NOT, AOI). AND and OR need an extra inverter stage: 6 transistors for a 2-input AND. NAND is often preferred over NOR because series nMOS are faster than series pMOS.

Mathematical

Y = 0 exactly when the pull-down Boolean function is true; the pull-up implements its complement by De Morgan duality. For NAND: pull-down = A·B, pull-up = ¬A + ¬B = ¬(A·B).

Applied

Standard-cell libraries used by chip designers contain hundreds of variants of these patterns at different sizes and drive strengths; synthesis tools turn RTL code into networks of them.

Worked example 1

Design the transistor networks for a 3-input NOR.

Pull-down: three nMOS in parallel (any input 1 pulls Y low). Pull-up: three pMOS in series (all inputs 0 to connect Y to VDD). 6 transistors.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 1. A pMOS transistor conducts when its gate is…

transistors

Practice 4. A student wires both networks of a gate so that, for input 11, both conduct. What happens?

Apply it

Sketch a CMOS gate for Y = NOT(A·B + C) using one pull-down network (A and B in series, that pair in parallel with C) and its dual pull-up. Check all 8 rows of the truth table.

Reflect

Why do you think CMOS won over earlier logic families for phones and laptops?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Doped silicon and the p–n junctionWhere a chip's power goes →