Compound Gates and Static CMOS Design

Turn a logic function into one static CMOS gate: a pull-down network, its dual as the pull-up network, and the transistor sizes.

You Will Be Able To

  • Derive the pull-down network of a gate from its function.
  • Build the pull-up network as the dual of the pull-down network.
  • Count the transistors of a function built as one compound gate and as simple gates.
  • Size a compound gate so that its worst path matches a unit inverter.
Lesson
G9.5
Time
30 min
Runs on
ngspice
Check
5 questions

A block needed y = NOT(a AND b OR c). The first netlist used a NAND, an inverter and a NOR: ten transistors in three stages. The library also had one gate for the whole function. It has six transistors, and here it answers 59.1 ps sooner.

TransientOne Compound Gate Against Three Simple GatesInput a rises. Input b is 1 and c is 0, so both outputs must fall. Each output drives 10 fF.
  • v(in)
  • v(ya), AOI21
  • v(yg), three gates
-0.5 V00.5 V1.0 V1.5 V2.0 V2.5 VVoltage00.2 ns0.4 ns0.6 ns0.8 ns1.0 ns1.2 ns1.4 ns1.6 nsTimehalf of the supplyAOI21: 37.4 ps after the inputthree gates: 96.5 ps-0.5 V00.5 V1.0 V1.5 V2.0 V2.5 VVoltage00.5 ns1.0 ns1.5 nsTimehalf of the supplyAOI21: 37.4 ps after the inputthree gates: 96.5 ps
  1. Time 225 psv(in) = 900 mV · v(ya), AOI21 = 1.955 V · v(yg), three gates = 1.8 V

    The input crosses 0.9 V. Both delays are counted from here.

  2. Time 262.4 psv(in) = 1.8 V · v(ya), AOI21 = 900.5 mV · v(yg), three gates = 1.874 V

    The compound gate crosses 0.9 V after 37.4 ps. The signal passed one stage.

  3. Time 321.5 psv(in) = 1.8 V · v(ya), AOI21 = 11.38 mV · v(yg), three gates = 900.1 mV

    The three-gate version crosses after 96.5 ps. The signal passed a NAND, an inverter and a NOR.

Read the plot as a table
Timev(in)v(ya), AOI21v(yg), three gates
0 s0 V1.8 V1.8 V
200 ps0 V1.8 V1.8 V
225 ps900 mV1.955 V1.8 V
262.4 ps1.8 V900.5 mV1.874 V
321.5 ps1.8 V11.38 mV900.1 mV
400 ps1.8 V17.45 µV1.322 mV
600 ps1.8 V710.3 nV372.4 nV
800 ps1.8 V710.5 nV371.3 nV
1 ns0 V1.678 V1.334 V
1.2 ns0 V1.8 V1.799 V
1.4 ns0 V1.8 V1.8 V
1.6 ns0 V1.8 V1.8 V

Measured with ngspice 42 on SKY130, 1.8 V, 50 ps input edge. Both versions are sized for unit drive.

From the Function to the Pull-Down Network

A static CMOS gate has two networks. The NMOS pull-down network connects the output to ground. So it must conduct exactly when the output is 0.

Write the function as y = NOT(f). The pull-down network then builds f directly. An AND in f becomes NMOS in series. An OR in f becomes NMOS in parallel.

From a Function to a Sized GateThe method of this lesson in four steps, for y = NOT(a AND b OR c).
  • Neutral
  • Device
  • Structure
From a function to a sized gateThe method of this lesson in four steps, for y = NOT(a AND b OR c). neutral Function y = NOT(a AND b ORc) device Pull-down network a, b in series; c inparallel device Pull-up network a, b in parallel; c inseries neutral Widths by transistors inseries AND: series, OR:paralleltake the dualmatch the inverter
  1. neutral Functiony = NOT(a AND b OR c)
    • AND: series, OR: parallel → Pull-down network
  2. device Pull-down networka, b in series; c in parallel
    • take the dual → Pull-up network
  3. device Pull-up networka, b in parallel; c in series
    • match the inverter → Widths
  4. neutral Widthsby transistors in series
  1. Read the function under the NOT

    The part under the NOT is a AND b OR c. It says when the output is 0.

  2. Build the pull-down network

    a AND b: two NMOS in series. OR c: one NMOS in parallel with that pair.

  3. Take the dual for the pull-up network

    Swap series and parallel. The PMOS of a and b go in parallel. The PMOS of c goes in series with them.

  4. Choose the widths

    Each path must be as strong as the unit inverter. A transistor on a path of two gets twice the width.

Read the diagram as text
  • Function: y = NOT(a AND b OR c)
  • Pull-down network: a, b in series; c in parallel
  • Pull-up network: a, b in parallel; c in series
  • Widths: by transistors in series
  • Function → Pull-down network: AND: series, OR: parallel
  • Pull-down network → Pull-up network: take the dual
  • Pull-up network → Widths: match the inverter

The same four steps work for any function of the form NOT(AND and OR of inputs).

An AOI21 Gate: y = NOT(a AND b OR c)Six transistors. In the pull-down network NA and NB are in series and NC is in parallel with them. The pull-up network is the opposite.
An AOI21 gate: y = NOT(a AND b OR c)VDD1.8 VPCPAPBNANBNCcababcy
  1. VDD · supply1.8 Vvdd → VDD
  2. PC · PMOS transistorgate → n1 · source → VDD · drain → n2
  3. PA · PMOS transistorgate → n3 · source → n2 · drain → n4
  4. PB · PMOS transistorgate → n5 · source → n2 · drain → n4
  5. NA · NMOS transistorgate → n6 · drain → n4 · source → n7
  6. NB · NMOS transistorgate → n8 · drain → n7 · source → 0
  7. NC · NMOS transistorgate → n9 · drain → n4 · source → 0
  8. gnd · groundgnd → 0
  9. c · portterminal → n1
  10. a · portterminal → n3
  11. b · portterminal → n5
  12. a · portterminal → n6
  13. b · portterminal → n8
  14. c · portterminal → n9
  15. y · portterminal → n4
  1. a = 0, b = 0, c = 0: y = 1

    All three PMOS are on. PC connects the supply to the inner node, and PA and PB both connect it to y. No NMOS is on.

  2. a = 1, b = 0, c = 0: y = 1

    PA is off, but PB is still on, and so is PC. One path to the supply is enough. NA is on, but NB is off, so the series path is open.

  3. a = 1, b = 1, c = 0: y = 0

    NA and NB are both on, so the series path connects y to ground. PA and PB are both off, so the pull-up is open.

  4. a = 0, b = 0, c = 1: y = 0

    NC alone connects y to ground. PC is off, and it is in series with the rest of the pull-up, so no path reaches the supply.

  5. a = 1, b = 1, c = 1: y = 0

    Both pull-down paths conduct. Every PMOS is off.

Read the circuit as text
  • PC PMOS transistor: gate → n1, source → VDD, drain → n2
  • PA PMOS transistor: gate → n3, source → n2, drain → n4
  • PB PMOS transistor: gate → n5, source → n2, drain → n4
  • NA NMOS transistor: gate → n6, drain → n4, source → n7
  • NB NMOS transistor: gate → n8, drain → n7, source → 0
  • NC NMOS transistor: gate → n9, drain → n4, source → 0
  • c port: terminal → n1
  • a port: terminal → n3
  • b port: terminal → n5
  • a port: terminal → n6
  • b port: terminal → n8
  • c port: terminal → n9
  • y port: terminal → n4

For each of the eight input rows exactly one network conducts.

This gate is called AOI21: AND-OR-INVERT, with a two-input AND and one more input. A gate that mixes series and parallel like this is a compound gate.

The Pull-Up Network Is the Dual

The PMOS pull-up network must conduct exactly when the pull-down network does not. The rule that gives this is duality: swap series and parallel, at every level.

In the AOI21 the pull-down is "a series b, in parallel with c". The dual is "a parallel b, in series with c". A PMOS turns on with a 0, so the dual network conducts for the opposite rows.

Swap the roles of the two networks and you get the OAI21: y = NOT((a OR b) AND c). Its NMOS of a and b are in parallel, with c in series.

GateFunctionPull-down (NMOS)Pull-up (PMOS)Transistors
AOI21NOT(a AND b OR c)(a series b) parallel c(a parallel b) series c6
OAI21NOT((a OR b) AND c)(a parallel b) series c(a series b) parallel c6
AOI22NOT(a AND b OR c AND d)(a series b) parallel (c series d)(a parallel b) series (c parallel d)8
NAND3NOT(a AND b AND c)3 in series3 in parallel6

Each input adds one NMOS and one PMOS, so a gate with n inputs has 2n transistors.

Counting Transistors for One Function

Every CMOS stage inverts. So AND and OR are not single gates: each is a NAND or a NOR followed by an inverter. A design that ignores this pays in transistors and in stages.

How y = NOT(a AND b OR c) is builtGatesTransistorsStages from a to y
One compound gateAOI2161
Simple gatesNAND2, inverter, NOR24 + 2 + 4 = 103
NAND gates and inverters onlyNAND2, inverter for c, NAND2, inverter4 + 2 + 4 + 2 = 123

The transistor counts follow from 2 transistors per gate input.

Fewer stages are also faster here. In the figure the compound gate falls after 37.4 ps and rises after 53.5 ps. The three-gate version needs 96.5 ps and 102.7 ps.

Sizing a Compound Gate

The unit inverter of this module has a 1 µm NMOS and a 2 µm PMOS. A gate has unit drive when its weakest pull-up and pull-down paths match that inverter.

Two transistors in series pass about half the current of one. So each gets twice the width. Count the transistors in series on the longest path through each transistor.

TransistorIn series on its pathWidth
NA, NB2 NMOS2 × 1 µm = 2 µm
NC1 NMOS1 µm
PA, PB, PC2 PMOS (PC with PA or PB)2 × 2 µm = 4 µm

The AOI21 sized for unit drive. Its total width is 17 µm; the unit inverter has 3 µm.

Switching inputSized gate: fall / riseEvery width 1 µm: fall / rise
a (b = 1, c = 0)37.4 / 53.5 ps52.7 / 153.9 ps
b (a = 1, c = 0)40.2 / 63.0 ps55.5 / 172.7 ps
c (a = 0, b = 1)57.1 / 63.0 ps40.0 / 163.5 ps

Measured: 10 fF load, 50 ps input edge, 50 % to 50 %. The unit inverter into the same load: 37.3 / 45.7 ps.

The sized gate is still slower than the inverter. Its wide transistors add their own capacitance at the output. Here that is gate overlap only, since these netlists leave the drain junctions at zero area. The slowest case is 63.0 ps.

With every width at 1 µm the rise takes up to 172.7 ps. Two weak PMOS in series charge the load.

Asked in interviews
  1. How do you draw the CMOS gate for a given function?

    Write it as NOT(f). Build f with NMOS between the output and ground: AND as series, OR as parallel. Then build the PMOS network as the dual, with series and parallel swapped, between the supply and the output.

  2. What is an AOI gate and why use one?

    AND-OR-INVERT: one CMOS stage that computes the inverse of an OR of ANDs. An AOI21 has 6 transistors. The same function from a NAND, an inverter and a NOR has 10 transistors and three stages.

  3. How do you size a compound gate?

    Make the worst pull-up path and the worst pull-down path as strong as the reference inverter. A transistor that sits in a series path of k transistors gets k times the unit width.

Try It

Each line is one delay in seconds. fall_a is the output falling after input a rises: 37.4 ps. rise_c is the output rising after input c falls: 63.0 ps.

Each copy holds the two other inputs so that the output follows the switching input. Copy C sets a to 0, so the only pull-up path is through PC and PB.

Set every W= value to 1 and run again. The falls change little, but the rises grow to 153.9 ps, 172.7 ps and 163.5 ps.

SPICEngspice 42 · simulator service
Edit the netlist, then run it
Expected measurements: fall_a = 3.744717e-11 targ= 1.062447e-09 trig= 1.025000e-09 rise_a = 5.349145e-11 targ= 3.128491e-09 trig= 3.075000e-09 fall_b = 4.021135e-11 targ= 1.065211e-09 trig= 1.025000e-09 rise_b = 6.302022e-11 targ= 3.138020e-09 trig= 3.075000e-09 fall_c = 5.713586e-11 targ= 1.082136e-09 trig= 1.025000e-09 rise_c = 6.302874e-11 targ= 3.138029e-09 trig= 3.075000e-09

Check Yourself

Predict the outputThis program builds an OAI21: y = NOT((a OR b) AND c). It prints y for the rows abc = 000 to 111. Predict the exact line.
module tb;
  logic a, b, c;
  wire  y, n, p;
  supply1 vdd;
  supply0 gnd;
  nmos na (y, n, a);       // pull-down: a and b in parallel
  nmos nb (y, n, b);
  nmos nc (n, gnd, c);     // c in series with both
  pmos pa (p, vdd, a);     // pull-up: a and b in series
  pmos pb (y, p, b);
  pmos pc (y, vdd, c);     // c in parallel with both
  initial begin
    for (int i = 0; i < 8; i++) begin
      {a, b, c} = i[2:0];
      #1 $write("%b", y);
    end
    $display("");
  end
endmodule
ConceptIn the function y = NOT(f), an OR inside f becomes which connection?
ConceptA true AND-OR function, y = a AND b OR c, is built in static CMOS. What is the smallest number of transistors?
ConceptIn the AOI21 sized for unit drive, why is NC only 1 µm wide while NA and NB are 2 µm?
ConceptA pull-up network is built with the same series and parallel shape as the pull-down network. What goes wrong?

Common Mistakes

Wrong Build the pull-up network with the same shape as the pull-down network.

Some rows then turn on both networks or neither. The switch-level run prints x or z for them.

Fix Swap series and parallel everywhere: series below means parallel above.

Before
pmos pa (p, vdd, a);   // series, like the NMOS
pmos pb (y, p, b);
pmos pc (y, vdd, c);
After
pmos pc (p, vdd, c);   // c in series
pmos pa (y, p, a);     // with a, b in parallel
pmos pb (y, p, b);

Wrong Forget that one CMOS stage inverts, and expect an AND-OR gate from six transistors.

NMOS can only pull down, so the six-transistor gate gives NOT(a AND b OR c). The true AND-OR needs an inverter after it: eight transistors.

Fix Design with inverting gates. Add an inverter only where the logic needs the true form.

Wrong Give every transistor of a compound gate the same width.

With every width at 1 µm the output rises in up to 172.7 ps here. The sized gate needs at most 63.0 ps.

Fix Widen each transistor by the number of transistors in series on its path.

Wrong Build a small function from NAND gates only, out of habit.

For NOT(a AND b OR c) that takes 12 transistors and three stages. The compound gate takes 6 transistors and one stage.

Fix Check whether the function, or its inverse, fits one compound gate first.

Remember

  • Write the function as NOT(f). The NMOS network builds f: AND is series, OR is parallel.
  • The PMOS network is the dual: swap series and parallel at every level.
  • A gate with n inputs has 2n transistors. AOI21 and OAI21 have 6.
  • Every stage inverts, so AND and OR cost an extra inverter.
  • For unit drive, multiply each width by the number of transistors in series on its path.

Practice

Report a problem with this page