---
title: Current mirrors in depth
heading: Accuracy, output resistance, compliance and matching
eyebrow: S2 · Lesson 7 · Current mirrors in depth
xp: 50
---

::: hook
Almost every analog IC is biased by copying one reference current to dozens of places with current mirrors. A mirror's job sounds simple, output the same current as the input, but four things spoil it: the output transistor's drain voltage differs from the input's, bipolar transistors steal base current, the two transistors don't quite match, and the output can't hold its current all the way down to zero volts. C6 met the simple mirror and the cascode. This lesson quantifies each error and shows the circuits that fix them: base-current compensation, the Wilson mirror, and the wide-swing cascode that keeps a cascode's accuracy at low supply voltages.
:::

::: play
- Output current (÷ the reference) against output voltage for three NMOS mirrors with $V_T$ = 0.4 V at overdrive $V_{ov}$: a simple mirror, a standard cascode, and a wide-swing cascode.
- The simple mirror works down to $V_{ov}$ but its current tilts with voltage as $\lambda$. The cascodes are almost flat, but the standard one needs $V_T + 2V_{ov}$ before it works; the wide-swing version only $2V_{ov}$.
- Raise λ (shorter channels) and watch the simple mirror's error grow while the cascodes barely move.
:::
:::

```sim plot
view: graph
x: V = 0..1.5 V
y: I = 0..1.3
slider: Vov = 0.1..0.4 = 0.2 V
slider: lam = 0.02..0.3 = 0.1 1/V
plot: (step(V - Vov)*(1 + lam*(V - 0.4 - Vov)) + (1 - step(V - Vov))*(2*V/Vov - (V/Vov)^2)*(1 - lam*0.4)) | samples: 600 | label: simple mirror
plot: (step(V - (0.4 + 2*Vov))*(1 + lam^2*Vov/2*(V - (0.4 + 2*Vov))) + (1 - step(V - (0.4 + 2*Vov)))*(2*V/(0.4 + 2*Vov) - (V/(0.4 + 2*Vov))^2)) | samples: 600 | color: ch2 | label: cascode mirror
plot: (step(V - (2*Vov))*(1 + lam^2*Vov/2*(V - (2*Vov))) + (1 - step(V - (2*Vov)))*(2*V/(2*Vov) - (V/(2*Vov))^2)) | samples: 600 | dashed | color: ch3 | label: wide-swing cascode
readout: simple mirror output resistance ÷ cascode's = lam*Vov/2
readout: cascode needs at least = 0.4 + 2*Vov V
readout: wide-swing cascode needs at least = 2*Vov V
```

::: predict
## An NMOS mirror's reference side sits at $V_{GS}$ = 0.6 V; its output is at 1.2 V, and λ = 0.1 V⁻¹. How far off is the copied current?

- [ ] Exact
- [ ] About 0.6% high
- [x] About 6% high
- [ ] About 60% high

::: reveal
$\frac{1 + \lambda V_{DS2}}{1 + \lambda V_{DS1}} = \frac{1.12}{1.06}$ = 1.057: 5.7% high, because the output transistor's drain is 0.6 V higher than the diode-connected input's. Short-channel processes, with λ of 0.1 to 0.3 V⁻¹, make this the dominant error, which is why accurate mirrors are cascoded or why the output's drain voltage is forced to match the input's.
:::
:::

::: nameit
## Systematic errors

- **Drain-voltage mismatch (MOS):** $\frac{I_\text{out}}{I_\text{ref}} = \frac{W_2/L_2}{W_1/L_1}\cdot\frac{1 + \lambda V_{DS2}}{1 + \lambda V_{DS1}}$. The same in bipolar with $V_A$.
- **Base current (bipolar):** both bases draw from the reference, so $\frac{I_\text{out}}{I_\text{ref}} = \frac{1}{1 + 2/\beta}$; with an area ratio N, $\frac{N}{1 + (N + 1)/\beta}$. A **beta helper** (an emitter follower supplying the base current) cuts the error to $\frac{2}{\beta(\beta + 1)}$.
- **Wilson mirror:** a three-transistor feedback mirror with an error of about $2/\beta^2$ and output resistance about $\beta r_o/2$.

## Output resistance and compliance

| Mirror | $R_\text{out}$ | Minimum output voltage |
|---|---|---|
| simple | $r_o$ | $V_{ov}$ |
| cascode | $\approx g_mr_o^2$ | $V_T + 2V_{ov}$ |
| wide-swing (low-voltage) cascode | $\approx g_mr_o^2$ | $2V_{ov}$ |

The wide-swing cascode biases the cascode transistor's gate at $V_T + 2V_{ov}$ from a separate branch, instead of stacking two diode drops, so the bottom transistor sits right at the edge of saturation.

## Random mismatch

Two nominally identical transistors differ in threshold and in $\mu C_{ox}$, so

$$\left(\frac{\sigma_{\Delta I}}{I}\right)^2 = \left(\frac{g_m}{I_D}\sigma_{\Delta V_T}\right)^2 + \left(\frac{\sigma_{\Delta\beta}}{\beta}\right)^2$$

with $\sigma_{\Delta V_T} = A_{VT}/\sqrt{WL}$ (S1.38). Mirrors use large areas and low $g_m/I_D$ (large overdrive) to keep this down.
:::

::: example
## An NMOS mirror ($V_{GS}$ = 0.6 V, λ = 0.1 V⁻¹) drives an output at 1.2 V. Find the error, and the error after cascoding with transistors of intrinsic gain 50.

::: solution
1. **Simple mirror.** Compare the $1 + \lambda V_{DS}$ factors at 1.2 V and 0.6 V:
   $$\begin{aligned} \frac{I_\text{out}}{I_\text{in}} &= \frac{1 + 0.12}{1 + 0.06} \\ &= 1.057 \end{aligned}$$
   a 5.7% error.
2. **Cascoded.** Cascoding multiplies the output resistance by about $g_mr_o$ = 50, so the output transistor's drain sees about a fiftieth of the voltage difference, and the error falls to about
   $$\frac{5.7\%}{50} \approx 0.11\%$$
3. **Cascoding both sides.** A cascode on both sides, with the input stack matching the output's, removes even that.

**Answer:** the simple mirror has a 5.7% error, and cascoding cuts it to about 0.11%.
:::
:::

::: example
## A bipolar mirror has β = 100. Find its error alone, with a beta helper, and as a Wilson mirror.

::: solution
1. **Simple mirror.**
   $$\begin{aligned} \frac{I_\text{out}}{I_\text{in}} &= \frac{1}{1 + 2/100} \\ &= 0.980 \end{aligned}$$
   a 2% error.
2. **Beta helper.**
   $$\begin{aligned} \frac{I_\text{out}}{I_\text{in}} &= \frac{1}{1 + 2/(100 \times 101)} \\ &= 0.9998 \end{aligned}$$
   a 0.02% error.
3. **Wilson mirror.** The error is about $2/\beta^2$, also 0.02%, with the bonus of a much higher output resistance.
4. **Where it matters most.** Base current errors scale as 1/β, so they're largest in PNP mirrors, whose β is often only 20 to 50.

**Answer:** a 2% error alone, 0.02% with a beta helper, and about 0.02% as a Wilson mirror.
:::
:::

::: example
## With $V_T$ = 0.5 V and $V_{ov}$ = 0.2 V, how low can the output of a standard cascode mirror go before it drops out of saturation, and a wide-swing cascode?

::: solution
1. **Standard cascode.** Its gate sits at $2(V_T + V_{ov})$, so its output needs
   $$\begin{aligned} V_T + 2V_{ov} &= 0.5 + 2 \times 0.2 \\ &= 0.9\ \text{V} \end{aligned}$$
2. **Wide-swing cascode.** It biases the cascode gate one $V_T + 2V_{ov}$ up from ground, so its output needs only
   $$2V_{ov} = 0.4\ \text{V}$$
3. **Compare.** On a 1.2 V supply that difference is most of the swing.

**Answer:** the standard cascode mirror's output can go down to 0.9 V, and the wide-swing cascode's to 0.4 V.
:::
:::

::: check
given: b = 30 | 100 | 300
answer: 1/(1 + 2/b)
tolerance: 0.1%

## A bipolar mirror has β = {b}. What's its output-to-reference current ratio?

::: right
Right. $\frac{1}{1 + 2/\beta}$ = {answer}.
:::

::: misses
- [1/(1 + 1/b)] Both transistors' bases draw from the reference: 2/β.
- [any] Not yet. Count the base currents taken from $I_\text{ref}$.
:::
:::

::: check
given: b = 20 | 50 | 100
answer: 1/(1 + 2/(b*(b + 1)))
tolerance: 0.01%

## A bipolar mirror with β = {b} gets a beta helper. What's its current ratio?

::: right
Right. $\frac{1}{1 + \frac{2}{\beta(\beta + 1)}}$ = {answer}.
:::

::: misses
- [1/(1 + 2/b)] The helper divides the base-current error by β + 1.
- [any] Not yet. The helper's own base current is the only error.
:::
:::

::: check
given: l = 0.05 | 0.15 | 0.3; G = 0.55 | 0.7; D = 1 | 1.8
answer: (1 + l*D)/(1 + l*G)
tolerance: 0.1%

## A MOS mirror's input sits at {G} V and its output at {D} V, with λ = {l} V⁻¹. What's the current ratio?

::: right
Right. $\frac{1 + \lambda V_{DS2}}{1 + \lambda V_{DS1}}$ = {answer}.
:::

::: misses
- [1 + l*D] The input transistor's own $\lambda V_{DS}$ divides it.
- [any] Not yet. Compare the two drain voltages.
:::
:::

::: check
given: T = 0.35 | 0.5; v = 0.1 | 0.2 | 0.3
answer: T + 2*v
unit: V
tolerance: 1%

## A standard NMOS cascode mirror has $V_T$ = {T} V and runs at $V_{ov}$ = {v} V. What's the lowest output voltage at which it still works as a cascode?

::: right
Right. $V_T + 2V_{ov}$ = {answer} V.
:::

::: misses
- [2*v] That's the wide-swing version; the standard cascode stacks two diodes.
- [any] Not yet. The cascode's gate sits two $V_{GS}$ up.
:::
:::

::: check
given: N = 2 | 4 | 10; b = 50 | 150
answer: N/(1 + (N + 1)/b)
tolerance: 0.1%

## A bipolar mirror's output transistor is {N} times the input's area, with β = {b}. What's the output-to-reference ratio?

::: right
Right. $\frac{N}{1 + (N + 1)/\beta}$ = {answer}.
:::

::: misses
- [N] Base currents of all N + 1 unit transistors come out of the reference.
- [N/(1 + 2/b)] The output's base draws N times more.
- [any] Not yet. The reference supplies every base current.
:::
:::

::: check
given: e = 6 | 12; s = 1 | 3; B = 0.5 | 1
answer: sqrt((e*s/10)^2 + B^2)
unit: %
tolerance: 1%

## A mirror runs at $g_m/I_D$ = {e} /V with $\sigma_{\Delta V_T}$ = {s} mV and $\sigma_{\Delta\beta}/\beta$ = {B}%. What's its current mismatch?

::: right
Right. $\sqrt{(g_m/I_D\cdot\sigma_{V_T})^2 + (\sigma_\beta/\beta)^2}$ = {answer}%.
:::

::: misses
- [e*s/10 + B] Independent errors add in quadrature.
- [any] Not yet. Convert both to percent and combine.
:::
:::

::: check
given: g = 0.5 | 2; o = 50 | 200
answer: g*o^2/1000
unit: MΩ
tolerance: 1%

## A cascode mirror uses transistors with $g_m$ = {g} mS and $r_o$ = {o} kΩ. Roughly what's its output resistance?

::: right
Right. $g_mr_o^2$ = {answer} MΩ.
:::

::: misses
- [o/1000] That's the simple mirror; the cascode multiplies by $g_mr_o$.
- [any] Not yet. Lesson 4's cascode.
:::
:::

::: check
kind: parts
given: l = 0.05 | 0.1 | 0.2; d = 0.3 | 0.6 | 1

## An NMOS mirror has λ = {l} V⁻¹, and its output sits {d} V above its diode side.

::: part
answer: l*d*100
unit: %
tolerance: 1%

### About how far off is the copy?

::: misses
- [any] $\lambda\Delta V$.
:::
:::

::: part
answer: l*d*100/(20)
unit: %
tolerance: 1%

### And after cascoding with transistors of intrinsic gain 20?

::: misses
- [any] Divided by the cascode's gain.
:::
:::
:::

::: check
kind: derivation
vars: b = 20..500

## A bipolar mirror has transistors of current gain b.

::: step
answer: 2/b

### What fractional error does the simple mirror have, about?
:::

::: step
answer: 2/(b*(b + 1))

### And with a beta helper?
:::

::: step
answer: 2/b^2

### And a Wilson mirror, about?
:::

::: right
Right. Each refinement multiplies the base-current error by about another 1/β.
:::
:::

::: explain
## Why does a wide-swing cascode mirror work at a lower output voltage than a standard cascode?

::: model
In a standard cascode mirror the cascode transistor's gate is biased by stacking two diode-connected transistors, which puts it at two gate-source voltages, $2V_T + 2V_{ov}$. The cascode device then holds the lower transistor's drain at $V_T + V_{ov}$, far more than the $V_{ov}$ it needs to stay saturated, and the output must sit a further $V_{ov}$ above that. The wide-swing version biases the cascode gate from a separate branch at only $V_T + 2V_{ov}$, so the lower transistor's drain sits at just $V_{ov}$, the edge of saturation. That saves a whole threshold voltage of headroom while keeping the cascode's high output resistance.
:::
:::

::: practice

::: check
given: b = 40 | 80 | 100 | 150 | 200 | 300
answer: 1/(1 + 2/b)
tolerance: 0.1%

## Bipolar mirror ratio, β = {b}?

::: misses
- [any] $1/(1 + 2/\beta)$.
:::
:::

::: check
given: l = 0.08 | 0.2; G = 0.6 | 0.75; D = 1.2 | 2
answer: (1 + l*D)/(1 + l*G)
tolerance: 0.1%

## MOS mirror ratio: λ = {l}, input {G} V, output {D} V?

::: misses
- [any] $(1 + \lambda V_{DS2})/(1 + \lambda V_{DS1})$.
:::
:::

::: check
given: N = 3 | 8; b = 40 | 120
answer: N/(1 + (N + 1)/b)
tolerance: 0.1%

## Ratioed bipolar mirror: N = {N}, β = {b}?

::: misses
- [any] $N/(1 + (N + 1)/\beta)$.
:::
:::
:::
