C7 · Lesson 8 · CMOS gates, sizing and power
From the inverter to NAND, NOR and complex gates
Every CMOS gate is built the same way as the inverter of lesson 7: a network of NMOS transistors that pulls the output down, and a mirror-image network of PMOS transistors that pulls it up, arranged so that exactly one of them conducts for any input. Transistors in series act like AND, in parallel like OR, and the pull-up network is the dual of the pull-down. That simple rule gives NAND and NOR gates with four transistors, and lets a single complex gate compute something like with six. It also explains why NAND gates are preferred over NOR, and where a chip's power goes.
- A two-input NAND gate at transistor level: two NMOS in series to ground, two PMOS in parallel to the supply. A and B are square waves at 1 kHz and 500 Hz, so together they step through all four input combinations.
- The output is low only while both inputs are high, when both series NMOS conduct and both parallel PMOS are off. Every other time, at least one PMOS pulls it up.
Predict
In a CMOS process where electrons are twice as mobile as holes, why do designers prefer NAND gates to NOR gates?
In a NOR gate the slow PMOS transistors are stacked in series, so each must be made about twice as wide again to drive as strongly as the inverter's, on top of being twice as wide as an NMOS already. A NAND stacks the fast NMOS instead. Same transistor count, but the NOR is bigger, has more input capacitance, and is slower.
Name it
Building a static CMOS gate
- Write the function inverted, = f(inputs), using AND and OR of the plain inputs.
- Pull-down network (NMOS, between the output and ground): AND becomes transistors in series, OR in parallel. It conducts exactly when the output should be 0.
- Pull-up network (PMOS, between the supply and the output): the dual, with series and parallel swapped. It conducts exactly when the pull-down doesn't.
| Gate | Pull-down (NMOS) | Pull-up (PMOS) | Transistors |
|---|---|---|---|
| NAND2, | A, B in series | A, B in parallel | 4 |
| NOR2, | A, B in parallel | A, B in series | 4 |
| AOI21, | (A series B) parallel C | (A parallel B) series C | 6 |
Static CMOS gates are naturally inverting; AND and OR take an extra inverter. An n-input NAND or NOR uses 2n transistors.
Sizing
Transistors in series add their resistances, so to drive as strongly as an inverter, each of n series devices must be n times wider. With electrons about twice as mobile as holes, a unit inverter has NMOS width 1 and PMOS width 2:
| Gate | NMOS width | PMOS width |
|---|---|---|
| inverter | 1 | 2 |
| NAND n | n | 2 |
| NOR n | 1 | 2n |
Wider transistors mean more input capacitance, so large fan-in gates get slow; designers split them into trees of smaller gates.
Power
Each output transition charges or discharges its load capacitance C, the inputs of the gates it drives plus wire. With an activity factor α (the fraction of clock cycles in which a node switches),
plus static leakage through transistors that are off, which grows as thresholds shrink. Lowering cuts dynamic power quadratically, and gating the clock off idle blocks cuts α.
Worked example
Size a NAND2 and a NOR2 to match a unit inverter (NMOS 1, PMOS 2). Compare their total widths.
Show the solution
- Size the NAND2. Series NMOS 2 each, parallel PMOS 2 each:
- Size the NOR2. Parallel NMOS 1 each, series PMOS 4 each:
- Compare the input loads. Each NOR2 input sees 1 + 4 = 5 units of gate against the NAND's 2 + 2 = 4, so the NAND is smaller and presents less load.
Answer the NAND2 totals 8 units of width and the NOR2 10; each NAND2 input presents 4 units of gate against the NOR2's 5.
Worked example
A block of 10⁶ gates, each with 2 fF of load, switches with α = 0.1 at 2 GHz on 0.9 V. What dynamic power does it use?
Show the solution
- Power at 0.9 V. With :
- Power at 1.2 V. With :
- Compare. The supply voltage is the strongest lever.
Answer 0.32 W at 0.9 V (0.58 W at 1.2 V).
Worked example
Size a three-input NAND to match a unit inverter (NMOS 1, PMOS 2). How much input capacitance does each input present, compared with the inverter?
Show the solution
- Size the NMOS. Three NMOS in series must together conduct like one unit NMOS, so each is 3 wide.
- Size the PMOS. The PMOS are in parallel, and the worst case is one alone pulling up, so each stays 2 wide.
- Add up one input's gate. Each input drives one NMOS and one PMOS: units of gate, against the inverter's 3.
- Logical effort. The ratio, , is the NAND3's logical effort: how much harder it is to drive than an inverter that delivers the same current.
- Wider gates. It grows with the number of inputs, which is why wide gates are split into trees of narrow ones.
Answer each NMOS is 3 wide and each PMOS 2, so each input presents 5 units of gate against the inverter's 3, a ratio of .
Check
How many transistors does a static CMOS NAND gate with 3 inputs use?
Check
A gate's pull-down network has NMOS A and B in series, and that pair in parallel with NMOS C. What is the pull-up network?
Check
That gate (NMOS A and B in series, in parallel with C) computes what?
Write AND as · or & (or just AB), OR as +, XOR as ⊕, and NOT as ¬ or a trailing ': A·B + C' works.
Check
In a process where electrons are 2 times as mobile as holes, a unit inverter has NMOS width 1 and PMOS width 2. How wide must each PMOS in a 3-input NOR be?
Check
1 million gates, each with 1 fF of load, switch with α = 0.05 at 3 GHz on 1.2 V. What dynamic power do they use?
Write units the way you normally would: 1.5 W, 1500 mW and 0.0015 kW are the same answer.
Check
A gate drives 4 gate inputs of 1 fF each through 4 fF of wire. What load capacitance does it see?
Write units the way you normally would: 1.5 fF and 0.0015 pF are the same answer.
Check
An n-input NAND with n = 3 is sized to match a unit inverter (NMOS 1, PMOS 2).
(a)
How many units of gate does each input drive?
(b)
What's its logical effort?
Check
An n-input NOR with n = 3 is sized to match a unit inverter (NMOS 1, PMOS 2).
(a)
How many units of gate does each input drive?
(b)
What's its logical effort?
Explain why
Why is a static CMOS gate's pull-up network the dual of its pull-down network?
For every input combination exactly one of the two networks must conduct: the pull-down when the output should be 0 and the pull-up when it should be 1, never both (that would short the supply) and never neither (that would leave the output floating). The pull-down conducts for the inverted function, built with series for AND and parallel for OR. PMOS transistors turn on when their inputs are low, and swapping series for parallel turns AND into OR; by De Morgan's laws that makes the pull-up conduct exactly when the pull-down doesn't.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.