---
title: CMOS layout
heading: Turning a transistor schematic into layers on silicon, the layers of an inverter's layout, design rules in units of λ, sizing the pMOS so the inverter switches at mid-supply, sharing diffusion between series transistors, wire resistance in squares, and laying out matched devices for analog circuits
eyebrow: D7 · Lesson 2 · CMOS layout
xp: 40
---

::: hook
A schematic says what's connected; a layout says exactly where every edge of every layer goes. An inverter's layout is a handful of rectangles: an n-type and a p-type active region, a strip of polysilicon crossing both to make the two gates, metal for power, ground and output, and contacts joining the layers. Get the shapes right and the circuit works; get them a few nanometers too close and the fab can't build it. Layout also decides speed and accuracy, since every wire has resistance and capacitance and every transistor's surroundings affect how well it matches its neighbors.
:::

::: play
- The switching threshold $V_M$ of a CMOS inverter (where output equals input) against the pMOS-to-nMOS width ratio, with $V_{DD}$ = 1 V, thresholds of ±0.3 V and electrons twice as mobile as holes.
- With equal widths the nMOS is stronger and pulls $V_M$ below mid-supply. Making the pMOS twice as wide balances the two, putting $V_M$ at exactly 0.5 V and making rise and fall times equal.
- Wider pMOS devices cost area and input capacitance, so many designs settle for a ratio between 1 and 2.
:::

```sim plot
view: graph
x: r = 0.25..6
y: V = 0.3..0.7
slider: m = 1.5..3 step 0.1 = 2
plot: (1 - 0.3 + 0.3*sqrt(m/r))/(1 + sqrt(m/r)) | samples: 300 | label: switching threshold, V (r = pMOS width over nMOS width)
plot: 0.5 + 0*r | dashed | color: ch3 | label: mid-supply
marker: x = m | label: balanced ratio
readout: threshold with equal widths, V = (1 - 0.3 + 0.3*sqrt(m))/(1 + sqrt(m)) | digits: 3
```

::: predict
## Electrons are twice as mobile as holes. For an inverter whose rise and fall are equally fast, how wide should the pMOS be compared with the nMOS?

- [ ] The same width
- [x] Twice as wide
- [ ] Half as wide
- [ ] Four times as wide

::: reveal
A transistor's current is proportional to its mobility times W/L. Doubling the pMOS width makes up for the holes' halved mobility, so both transistors drive the same current, the output rises as fast as it falls, and the switching threshold sits at mid-supply: 0.5 V here, against 0.466 V with equal widths.
:::
:::

::: nameit
## The layers

A CMOS layout is drawn in layers, each becoming one mask:

- **n-well**, where the pMOS transistors sit;
- **active** (diffusion), the regions of silicon that become sources, drains and channels;
- **polysilicon** (or the metal gate), which forms a transistor wherever it crosses active;
- **contacts and vias**, joining layers vertically;
- **metal 1, metal 2, ...**, the wiring.

An inverter is two active regions, one in the n-well, crossed by a single vertical strip of gate, with the drains joined in metal as the output and the sources tied to power and ground rails.

## Design rules

Minimum widths, spacings, overlaps and enclosures that the process can reliably build, often taught in units of λ (half the minimum feature): gates 2λ long, metal 3λ wide and 3λ apart. Real processes have thousands of rules, checked by the design-rule checker (DRC).

## Sizing

The inverter switches at

$$V_M = \frac{V_{DD} - |V_{Tp}| + V_{Tn}\sqrt{\beta_n/\beta_p}}{1 + \sqrt{\beta_n/\beta_p}}$$

with $\beta = \mu C_\text{ox}W/L$. Equal strengths, $W_p/W_n = \mu_n/\mu_p$, put it at $V_{DD}/2$ when the thresholds match.

## Sharing diffusion

Transistors in series (as in a NAND's nMOS stack) can share a source/drain region, saving area and capacitance. Ordering the gates along an **Euler path** through the circuit's graph lets one unbroken strip of active serve them all.

## Wires and matching

A wire's resistance is its sheet resistance times its length in squares: $R = R_\square L/W$. Analog layouts place matched transistors close together, in the same orientation, often interleaved in a **common-centroid** pattern so gradients across the die cancel; random mismatch still follows Pelgrom's law, $\sigma_{\Delta V_T} = A_{VT}/\sqrt{WL}$, so halving it takes four times the area.
:::

::: example
## A 1 mm long wire 50 nm wide has a sheet resistance of 0.1 Ω/□. What's its resistance?

::: solution
1. **Count the squares.**
   $$\frac{1\ \text{mm}}{50\ \text{nm}} = 20\,000$$
2. **Resistance.**
   $$20\,000 \times 0.1\ \Omega = 2\ \text{k}\Omega$$
   enough to slow a signal noticeably, which is why long wires run on the thicker upper metals.

**Answer:** the wire has 2 kΩ of resistance.
:::
:::

::: example
## A process has $A_{VT}$ = 3 mV·µm. What's the threshold mismatch between two 1 × 0.1 µm transistors, and what area brings it to under 3 mV?

::: solution
1. **Mismatch of the small pair.** Each transistor's area is 0.1 µm²:
   $$\begin{aligned} \sigma &= \frac{3}{\sqrt{0.1}}\ \text{mV} \\ &= 9.5\ \text{mV} \end{aligned}$$
2. **Area for 3 mV.** √(WL) must be 1 µm, so WL = 1 µm², ten times the area.

**Answer:** the mismatch is 9.5 mV, and it takes 1 µm² per transistor, ten times the area, to bring it to 3 mV.
:::
:::

::: example
## The 1 mm, 2 kΩ wire also has 0.2 fF of capacitance per µm. About how long does a signal take to cross it?

::: solution
1. **Wire capacitance.**
   $$\begin{aligned} C &= 0.2\ \text{fF}/\mu\text{m} \times 1000\ \mu\text{m} \\ &= 200\ \text{fF} \end{aligned}$$
2. **Delay to the 50% point.** A distributed RC line gets there after about $0.38RC$:
   $$\begin{aligned} t &= 0.38 \times 2\ \text{k}\Omega \times 200\ \text{fF} \\ &= 152\ \text{ps} \end{aligned}$$
3. **Long wires.** Delay grows with the square of length, so long wires are broken into segments with repeaters, which makes the delay grow only linearly.

**Answer:** a signal takes about 152 ps to cross the wire.
:::
:::

::: check
given: r = 0.5 | 1 | 3; m = 2 | 2.5
answer: (1 - 0.3 + 0.3*sqrt(m/r))/(1 + sqrt(m/r))
unit: V
tolerance: 0.5%

## A 1 V inverter has thresholds of ±0.3 V, $\mu_n/\mu_p$ = {m} and a pMOS {r} times as wide as its nMOS (same lengths). Where does it switch?

::: right
Right. $V_M$ = {answer} V.
:::

::: misses
- [0.5] That's only true when the strengths match.
- [any] Not yet. Use $\sqrt{\beta_n/\beta_p} = \sqrt{(\mu_n/\mu_p)/(W_p/W_n)}$.
:::
:::

::: check
given: A = 2 | 3.5 | 5; W = 0.5 | 1 | 4; L = 0.05 | 0.1 | 0.5
answer: A/sqrt(W*L)
unit: mV
tolerance: 0.5%

## A process has $A_{VT}$ = {A} mV·µm. What's the standard deviation of the threshold difference between two {W} × {L} µm transistors?

::: right
Right. $A_{VT}/\sqrt{WL}$ = {answer} mV.
:::

::: misses
- [A/(W*L)] Pelgrom's law uses the square root of the area.
- [any] Not yet. Mismatch falls as one over the square root of the area.
:::
:::

::: check
given: L = 0.1 | 1 | 5; W = 0.05 | 0.2 | 1; R = 0.03 | 0.1 | 0.5
answer: R*L*1000/W
unit: Ω
tolerance: 0.5%

## A wire {L} mm long and {W} µm wide has a sheet resistance of {R} Ω/□. What's its resistance?

::: right
Right. $R_\square L/W$ = {answer} Ω.
:::

::: misses
- [R*L/W] Put L and W in the same units: L/W is a count of squares.
- [any] Not yet. Count the squares.
:::
:::

::: check
given: n = 1350 | 1400; p = 450 | 480 | 500
answer: n/p
tolerance: 0.5%

## A process's electron and hole mobilities are {n} and {p} cm²/V·s. What pMOS-to-nMOS width ratio gives equal drive?

::: right
Right. $\mu_n/\mu_p$ = {answer}.
:::

::: misses
- [p/n] The weaker pMOS must be the wider one.
- [any] Not yet. Equal $\mu W$.
:::
:::

::: check
kind: parts
given: L = 0.1 | 1 | 5; w = 20 | 50 | 100; r = 0.05 | 0.1 | 0.2

## A wire {L} mm long and {w} nm wide has a sheet resistance of {r} Ω/□.

::: part
answer: L*1e6/w
unit: squares
tolerance: 0.5%

### How many squares long is it?

::: misses
- [any] Length ÷ width.
:::
:::

::: part
answer: L*1e6/w*r
unit: Ω
tolerance: 0.5%

### What is its resistance?

::: misses
- [any] Squares × sheet resistance.
:::
:::
:::

::: check
kind: parts
given: R = 0.5 | 2 | 5; c = 0.1 | 0.2; L = 0.5 | 1 | 2

## A wire has {R} kΩ of resistance per mm and {c} fF of capacitance per µm, and is {L} mm long.

::: part
answer: 0.38*R*1000*L*c*1e-15*L*1000*1e12
unit: ps
tolerance: 0.5%

### What is its distributed RC delay, 0.38RC?

::: misses
- [any] Both R and C grow with length.
:::
:::

::: part
answer: 0.38*R*1000*2*L*c*1e-15*2*L*1000*1e12
unit: ps
tolerance: 0.5%

### And at twice the length?

::: misses
- [any] Four times: delay grows as length squared.
:::
:::
:::

::: check
kind: parts
given: A = 1 | 3 | 5; W = 0.1 | 1 | 4; L = 0.05 | 0.5

## A process has $A_{VT}$ = {A} mV·µm; a transistor pair is {W} µm by {L} µm.

::: part
answer: A/sqrt(W*L)
unit: mV
tolerance: 0.5%

### What is the pair's threshold mismatch σ?

::: misses
- [any] $A_{VT}/\sqrt{WL}$.
:::
:::

::: part
answer: 4*W*L
unit: µm²
tolerance: 0.5%

### What area halves it?

::: misses
- [any] Four times the area.
:::
:::
:::

::: check
kind: parts
given: v = 0.3 | 0.4; g = 1 | 2 | 3; m = 2 | 2.5

## A CMOS inverter has $V_{DD}$ = 1 V and thresholds of {v} V for both transistors. Its PMOS is {g} times as wide as its NMOS, and holes are {m} times less mobile than electrons.

::: part
answer: (v + sqrt(g/m)*(1 - v))/(1 + sqrt(g/m))
unit: V
tolerance: 0.5%

### Where is its switching threshold (square-law estimate)?

::: misses
- [any] Equal currents: $\sqrt{\beta_n}(V_M - V_{Tn}) = \sqrt{\beta_p}(V_{DD} - V_M - |V_{Tp}|)$, with $\beta_p/\beta_n = g/m$.
:::
:::

::: part
answer: m
tolerance: 0.5%

### What width ratio would put it at 0.5 V?

::: misses
- [any] Equal strengths: width ratio = mobility ratio.
:::
:::
:::

::: explain
## Why are matched analog transistors laid out side by side, often interleaved?

::: model
Two transistors that should be identical will differ for two reasons. Systematic variations, such as gradients in oxide thickness, doping or temperature across the die, make a transistor's properties depend on where it sits, so placing the pair far apart builds in a difference. Random variations from the discrete dopant atoms and edge roughness of each device average out over its area, so they shrink only with size. Placing matched devices next to each other, in the same orientation, and splitting each into pieces arranged around a common center makes them sample the same gradients, which cancel, leaving only the random part, which designers then control by choosing the area.
:::
:::

::: practice

::: check
given: A = 1 | 10; W = 0.1 | 20; L = 0.02 | 2
answer: A/sqrt(W*L)
unit: mV
tolerance: 0.5%

## Pelgrom σ: $A_{VT}$ = {A} mV·µm, {W} × {L} µm?

::: misses
- [any] $A_{VT}/\sqrt{WL}$.
:::
:::

::: check
given: L = 0.01 | 10; W = 0.02 | 5; R = 0.02 | 1
answer: R*L*1000/W
unit: Ω
tolerance: 0.5%

## Wire resistance: {L} mm, {W} µm, {R} Ω/□?

::: misses
- [any] $R_\square L/W$.
:::
:::
:::
