---
title: Logical effort and gate sizing
heading: Estimating CMOS path delay and choosing the number and size of stages
eyebrow: S3 · Lesson 18 · Logical effort and gate sizing
xp: 50
---

::: hook
How fast can a chain of gates drive a large load, and how big should each gate be? The method of logical effort answers both with a few multiplications. Every gate's delay is its effort, how much worse it is at driving than an inverter, times its electrical fanout, plus a fixed parasitic part. Along a path, the delay is smallest when every stage bears the same effort, about 4, which tells a designer how many stages to use and how to size each one. It's how a buffer chain to a big clock net gets designed, and why a high-fanin NOR gate is avoided in fast paths.
:::

::: play
- The delay of a path whose total effort is F, in units of τ (the delay of an ideal inverter with no parasitics), against the number of stages N, when every stage bears effort $F^{1/N}$ and adds one unit of parasitic delay.
- Too few stages and each must drive an enormous fanout; too many and the parasitic delays add up. The minimum sits near $N = \log_4F$, where each stage has effort about 4.
- Raise F: the best N grows as its logarithm, so a 1000× load needs only five stages.
:::
:::

```sim plot
view: graph
x: N = 1..14
y: D = 0..80
slider: F = 4..100000 = 1000 log
plot: N*F^(1/N) + N | samples: 300 | label: path delay, τ
marker: x = log(F)/log(4) | label: N = log₄F
readout: best number of stages = log(F)/log(4)
readout: delay with that N, τ = log(F)/log(4)*4 + log(F)/log(4)
```

::: predict
## A small gate must drive a load 1000 times its input capacitance through a chain of inverters. About how many inverters give the least delay?

- [ ] 1: the fewest stages is fastest
- [ ] 3
- [x] About 5
- [ ] 1000

::: reveal
About five. The best stage effort is about 4, so the number of stages is $\log_41000$ ≈ 5, each inverter about four times the size of the one before. A single inverter would have a stage effort of 1000 and a delay near 1000τ; five stages give about 25τ. Real designs pick an integer near $\log_4F$, and the delay is flat enough around the minimum that 4 or 6 stages cost only a few percent more.
:::
:::

::: nameit
## The delay of one gate

$$d = gh + p$$

in units of τ, where:

- **g, the logical effort:** how much more input capacitance the gate needs than an inverter to deliver the same output current. Inverter 1; n-input NAND $\frac{n + 2}{3}$; n-input NOR $\frac{2n + 1}{3}$.
- **h, the electrical effort:** output capacitance over input capacitance.
- **p, the parasitic delay:** about 1 for an inverter, about n for an n-input NAND or NOR.

The **fanout-of-4 (FO4) inverter delay**, $4 + 1 = 5\tau$, is the common yardstick for a process's speed.

## Along a path

- Path logical effort $G = \prod g_i$, electrical effort $H = C_\text{load}/C_\text{in}$, branching effort B (the product of the branching at each fork), and path effort $F = GBH$.
- The delay is least when every stage bears the same effort $f = F^{1/N}$, giving

$$D = NF^{1/N} + P, \qquad P = \sum p_i$$

- The best number of stages is about $\log_4F$; adding inverters to a path with too few stages lowers its delay.

## Sizing

Work backward from the load: each stage's input capacitance is $C_{\text{in},i} = \frac{g_iC_{\text{out},i}}{f}$.

## What it tells a designer

- High-fanin gates are slow: a 4-input NOR has g = 3, three times an inverter.
- NAND beats NOR in CMOS because holes are slower than electrons.
- A big load should be driven through a tapered chain of gates: a single huge gate would load its own driver just as badly.
:::

::: example
## A path is an inverter, a 2-input NAND, a 2-input NOR and an inverter, driving 64 times the first gate's input capacitance with no branching. What's its least delay, and its stage effort?

::: solution
1. **Path effort.**
   $$\begin{aligned} G &= 1 \times \tfrac{4}{3} \times \tfrac{5}{3} \times 1 \\ &= 2.22 \end{aligned}$$
   and with $H = 64$:
   $$\begin{aligned} F &= GH \\ &= 142 \end{aligned}$$
2. **Stage effort.** With four stages:
   $$\begin{aligned} f &= 142^{1/4} \\ &= 3.45 \end{aligned}$$
3. **Delay.** The parasitics are $P = 1 + 2 + 2 + 1 = 6$, so
   $$\begin{aligned} D &= 4 \times 3.45 + 6 \\ &= 19.8\tau \end{aligned}$$
   about 4 FO4 delays.
4. **Check the stage count.** Each stage's effort, 3.45, is close to the ideal 4, so four stages is about right.

**Answer:** the least delay is 19.8τ (about 4 FO4), with a stage effort of 3.45.
:::
:::

::: example
## Design a buffer chain to drive a load 1000 times the input capacitance. How many inverters, what taper, and what delay?

::: solution
1. **Number of stages.**
   $$\log_4 1000 = 4.98$$
   so 5 inverters.
2. **Taper.** Each is larger than the last by
   $$1000^{1/5} = 3.98$$
   giving input sizes 1, 4, 16, 63 and 251 (and the load is 1000).
3. **Delay.**
   $$\begin{aligned} D &= 5 \times 3.98 + 5 \\ &= 24.9\tau \end{aligned}$$
4. **Against one big inverter.** A single inverter sized to drive the load from the same input would take about 1001τ.

**Answer:** 5 inverters with a taper of 3.98, for a delay of 24.9τ.
:::
:::

::: example
## A 3-input NAND drives 20 times its own input capacitance. What is its delay alone, and with two inverters added after it?

::: solution
1. **Path effort.**
   $$\begin{aligned} F &= gH \\ &= \tfrac53 \times 20 \\ &= 33.3 \end{aligned}$$
2. **Alone.**
   $$\begin{aligned} D &= 33.3 + 3 \\ &= 36.3\tau \end{aligned}$$
3. **With two inverters.** They keep the polarity, and each of the three stages bears $33.3^{1/3} = 3.22$:
   $$\begin{aligned} D &= 3 \times 3.22 + 3 + 1 + 1 \\ &= 14.7\tau \end{aligned}$$
   More than twice as fast, by adding gates.

**Answer:** 36.3τ alone and 14.7τ with two inverters added.
:::
:::

::: check
given: n = 2 | 3 | 4
answer: (n + 2)/3
tolerance: 0.5%

## What's the logical effort of an {n}-input NAND gate?

::: right
Right. $\frac{n + 2}{3}$ = {answer}.
:::

::: misses
- [(2*n + 1)/3] That's a NOR gate.
- [any] Not yet. The series NMOS stack must be n times wider.
:::
:::

::: check
given: n = 2 | 3 | 4
answer: (2*n + 1)/3
tolerance: 0.5%

## What's the logical effort of an {n}-input NOR gate?

::: right
Right. $\frac{2n + 1}{3}$ = {answer}.
:::

::: misses
- [(n + 2)/3] That's a NAND; the NOR's series PMOS stack is worse.
- [any] Not yet. The series PMOS stack must be n times wider, and PMOS is slower.
:::
:::

::: check
given: g = 1 | 1.33 | 1.67; h = 2 | 4 | 8; p = 1 | 2
answer: g*h + p
tolerance: 1%

## A gate with logical effort {g}, electrical effort {h} and parasitic delay {p}: what's its delay in τ?

::: right
Right. $gh + p$ = {answer}τ.
:::

::: misses
- [g*h] Include the parasitic delay.
- [any] Not yet. Effort delay plus parasitic delay.
:::
:::

::: check
given: F = 64 | 1000 | 30000
answer: log(F)/log(4)
tolerance: 1%

## A path has effort F = {F}. What's the best number of stages?

::: right
Right. $\log_4F$ = {answer}; round to a nearby integer.
:::

::: misses
- [log(F)/log(2)] The best stage effort is about 4, so take the logarithm base 4.
- [any] Not yet. Stage effort about 4 each.
:::
:::

::: check
given: F = 50 | 500 | 5000; N = 3 | 5; P = 4 | 8
answer: N*F^(1/N) + P
tolerance: 1%

## A path with effort {F} and parasitic delay {P} is built with {N} stages. What's its least delay, in τ?

::: right
Right. $NF^{1/N} + P$ = {answer}τ.
:::

::: misses
- [N*F/N + P] Efforts multiply along a path, so each stage bears $F^{1/N}$.
- [any] Not yet. Equal effort per stage.
:::
:::

::: check
given: G = 1 | 2.22 | 5; B = 1 | 2; H = 10 | 100
answer: G*B*H
tolerance: 1%

## A path has logical effort {G}, branching effort {B} and electrical effort {H}. What's its path effort?

::: right
Right. F = GBH = {answer}.
:::

::: misses
- [any] Not yet. The three efforts multiply.
:::
:::

::: check
given: g = 1.33 | 1.67 | 2.33; C = 20 | 100; f = 3 | 4
answer: g*C/f
unit: fF
tolerance: 1%

## A stage with logical effort {g} drives {C} fF at a stage effort of {f}. What should its input capacitance be?

::: right
Right. $C_\text{in} = gC_\text{out}/f$ = {answer} fF.
:::

::: misses
- [C/f] Include the gate's logical effort.
- [any] Not yet. Rearrange $f = gC_\text{out}/C_\text{in}$.
:::
:::

::: check
kind: parts
given: n = 2 | 3 | 4; h = 1 | 4 | 8

## An {n}-input gate drives {h} times its own input capacitance.

::: part
answer: (n + 2)/3*h + n
unit: τ
tolerance: 0.5%

### What delay does a NAND have?

::: misses
- [any] $gh + p$ with $g = (n + 2)/3$, $p = n$.
:::
:::

::: part
answer: (2*n + 1)/3*h + n
unit: τ
tolerance: 0.5%

### And a NOR?

::: misses
- [any] $g = (2n + 1)/3$.
:::
:::
:::

::: check
kind: derivation
vars: F = 2..10000, N = 1..10, P = 1..20

## A path has path effort F, N stages and total parasitic delay P.

::: step
answer: F^(1/N)

### What effort should each stage bear?
:::

::: step
answer: N*F^(1/N) + P

### What is the path's least delay?
:::

::: step
answer: ln(F)/ln(4)

### About how many stages minimize it?
:::

::: right
Right. A stage effort near 4 is close to optimal, which is why FO4 is the natural unit of delay.
:::
:::

::: check
kind: python

## Write `path_delay(g, p, H, B=1.0)`: for a path whose stages have logical efforts g and parasitic delays p, electrical effort H and branching B, return (least delay D in τ, stage effort f, input capacitances of the stages relative to the first, working back from the load).

```python starter
def path_delay(g, p, H, B=1.0):
    return (0.0, 1.0, [])
```

```python solution
def path_delay(g, p, H, B=1.0):
    G = 1.0
    for x in g:
        G *= x
    N = len(g)
    f = (G * B * H) ** (1 / N)
    D = N * f + sum(p)
    cin, cout = [0.0] * N, H * B
    for i in range(N - 1, -1, -1):
        cin[i] = g[i] * cout / f
        cout = cin[i]
    return (D, f, cin)
```

```python tests
D, f, c = path_delay([1, 4 / 3, 5 / 3, 1], [1, 2, 2, 1], 64)
assert abs(D - 19.81) < 0.01 and abs(f - 3.453) < 0.001, "The worked example: 19.8τ at a stage effort of 3.45."
assert abs(c[0] - 1) < 1e-9, "Working back from the load lands on the first gate's own size."
D5, f5, c5 = path_delay([1] * 5, [1] * 5, 1000)
assert abs(f5 - 3.981) < 0.001 and abs(D5 - 24.91) < 0.01, "Five inverters for 1000×: taper 3.98, 24.9τ."
```

::: right
Right. Sizing backward from the load with the same effort per stage is the whole method; the first stage's size coming out right checks the arithmetic.
:::
:::

::: explain
## Why is a path fastest when every stage bears the same effort?

::: model
The delay of a path is the sum of each stage's effort delay plus fixed parasitic delays, and the product of the stage efforts is fixed by the path's logic, branching and load. A sum of positive numbers with a fixed product is smallest when the numbers are all equal, the same reason a rectangle of fixed area has the least perimeter when it's a square. If one stage bore more effort than the others, shrinking it slightly and enlarging its neighbors would lower that stage's delay by more than it raised theirs. So the optimum sizes every gate so that each stage carries $F^{1/N}$, and the best N then balances effort delay against the parasitic delay each stage adds.
:::
:::

::: practice

::: check
given: n = 2 | 3 | 4 | 5 | 6
answer: (n + 2)/3
tolerance: 0.5%

## Logical effort of an {n}-input NAND?

::: misses
- [any] $(n + 2)/3$.
:::
:::

::: check
given: F = 64 | 200 | 1000 | 2000 | 8000 | 50000
answer: log(F)/log(4)
tolerance: 1%

## Best stage count for F = {F}?

::: misses
- [any] $\log_4F$.
:::
:::

::: check
given: F = 100 | 2000; N = 4 | 6; P = 5 | 9
answer: N*F^(1/N) + P
tolerance: 1%

## Least delay: F = {F}, N = {N}, P = {P}?

::: misses
- [any] $NF^{1/N} + P$.
:::
:::
:::
