---
title: Current mirrors and differential pairs
heading: The two building blocks of analog IC design, the current mirror that copies a reference current by a ratio of transistor sizes and its error from channel-length modulation, output resistance and the cascode, and the differential pair that steers a tail current in response to a difference in voltage
eyebrow: D7 · Lesson 4 · Current mirrors and differential pairs
xp: 40
---

::: hook
On a chip, resistors are big and imprecise and capacitors are small, but transistors are cheap and match each other closely when drawn side by side. Analog designers therefore build almost everything from two transistor pairs. The **current mirror** copies one current to as many places as needed, scaled by the ratio of transistor widths. The **differential pair** responds only to the difference between two inputs and ignores what they share, which is what lets an op amp amplify a microvolt signal riding on a volt of noise. Nearly every analog block, from op amps to comparators to ADCs, starts with them.
:::

::: play
- A differential pair's output, the difference of its two drain currents as a fraction of the tail current, against the input difference, for MOSFETs biased at overdrive $V_{OV}$ (solid) and for bipolar transistors (dashed, $\tanh(\Delta V/2V_T)$).
- Near zero the response is linear with slope $g_m$; farther out the pair runs out of tail current and saturates. MOSFETs steer all the current at $\sqrt{2}V_{OV}$.
- A larger overdrive widens the linear range but lowers the gain per volt: the pair trades linearity against transconductance.
:::

```sim plot
view: graph
x: d = -0.6..0.6
y: I = -1.1..1.1
slider: v = 0.05..0.4 step 0.01 = 0.2
plot: step(sqrt(2)*v - abs(d))*(d/v)*sqrt(abs(1 - d^2/(4*v^2))) + step(abs(d) - sqrt(2)*v)*sign(d) | samples: 600 | label: MOS pair, ΔI/I_tail (d = ΔV in V)
plot: tanh(d/(2*0.02585)) | samples: 600 | dashed | color: ch3 | label: bipolar pair
readout: MOS linear range, ± mV = sqrt(2)*v*1000 | digits: 3
readout: MOS output at 0.1 V input = step(sqrt(2)*v - 0.1)*(0.1/v)*sqrt(abs(1 - 0.01/(4*v^2))) + step(0.1 - sqrt(2)*v) | digits: 3
```

::: predict
## A current mirror's input transistor carries 100 µA and its output transistor is four times as wide. Ignoring channel-length modulation, what current does the output carry?

- [ ] 25 µA
- [ ] 100 µA
- [x] 400 µA
- [ ] 1.6 mA

::: reveal
Both transistors have the same gate-source voltage, so in saturation their currents are proportional to W/L: 4 × 100 µA = 400 µA. In practice the output's higher drain voltage makes it carry a little more, a few percent with a typical λ, which a cascode removes.
:::
:::

::: nameit
## The current mirror

A diode-connected transistor M1 (gate tied to drain) carrying $I_\text{ref}$ sets a gate voltage; M2 shares it, so

$$I_\text{out} = I_\text{ref}\frac{(W/L)_2}{(W/L)_1}\cdot\frac{1 + \lambda V_{DS2}}{1 + \lambda V_{DS1}}$$

The second factor is the error from channel-length modulation. The output resistance is $r_o = 1/(\lambda I_D)$. A **cascode**, a second transistor stacked on the output, multiplies it to about $g_mr_o^2$ and holds M2's drain voltage nearly fixed.

## The differential pair

Two matched transistors share a tail current $I_\text{tail}$. A difference ΔV between their gates steers current from one to the other; a voltage common to both changes nothing. For small ΔV, each side's current changes by $\pm g_m\Delta V/2$, with $g_m = 2I_D/V_{OV}$ for each MOSFET at its half of the tail. For larger inputs, the MOS pair's output is

$$\frac{\Delta I}{I_\text{tail}} = \frac{\Delta V}{V_{OV}}\sqrt{1 - \frac{\Delta V^2}{4V_{OV}^2}}, \qquad |\Delta V| \le \sqrt{2}V_{OV}$$

and a bipolar pair's is $\tanh(\Delta V/2V_T)$, linear over only a few tens of millivolts.

## Together

A differential pair loaded by a current mirror (a five-transistor amplifier, the first stage of most op amps) converts the differential current to a single output with gain $g_m(r_{o2} \parallel r_{o4})$.
:::

::: example
## A mirror has λ = 0.1 V⁻¹, with its diode at 0.5 V and its output at 1.5 V. How far off is the copied current? What's the output resistance at 100 µA, and with a cascode at $g_m$ = 1 mS?

::: solution
1. **Copy error.** Each current scales as $1 + \lambda V_{DS}$:
   $$\begin{aligned} \frac{I_\text{out}}{I_\text{ref}} &= \frac{1 + 0.15}{1 + 0.05} \\ &= 1.095 \end{aligned}$$
   so the copy is 9.5% high.
2. **Output resistance.**
   $$\begin{aligned} r_o &= \frac{1}{0.1\ \text{V}^{-1} \times 100\ \mu\text{A}} \\ &= 100\ \text{k}\Omega \end{aligned}$$
3. **With a cascode.**
   $$\begin{aligned} R_\text{out} &\approx 1\ \text{mS} \times (100\ \text{k}\Omega)^2 \\ &= 10\ \text{M}\Omega \end{aligned}$$

**Answer:** the copy is 9.5% high, and the output resistance is 100 kΩ, about 10 MΩ with the cascode.
:::
:::

::: example
## A MOS pair with 100 µA of tail current runs at 0.2 V of overdrive into a mirror load, with λ = 0.1 V⁻¹. What's its gain, and its output for a 0.1 V input?

::: solution
1. **Transconductance.** Each side carries 50 µA:
   $$\begin{aligned} g_m &= \frac{2 \times 50\ \mu\text{A}}{0.2\ \text{V}} \\ &= 0.5\ \text{mS} \end{aligned}$$
2. **Output resistance.**
   $$\begin{aligned} r_o &= \frac{1}{0.1\ \text{V}^{-1} \times 50\ \mu\text{A}} \\ &= 200\ \text{k}\Omega \end{aligned}$$
3. **Gain.** The output sees two of those in parallel, 100 kΩ:
   $$0.5\ \text{mS} \times 100\ \text{k}\Omega = 50$$
4. **A 0.1 V input.** The pair steers this fraction of the tail current:
   $$\frac{0.1}{0.2}\sqrt{1 - 0.0625} = 0.484$$
5. **Bipolar comparison.** A bipolar pair would already be at tanh(1.93) = 0.959.

**Answer:** the gain is 50, and a 0.1 V input steers 0.484 of the tail current (0.959 for a bipolar pair).
:::
:::

::: example
## A mirror's output transistor is five times as wide as its diode-connected one, with 20 µA of reference current. What does it copy, and what if its drain sits 1 V above the diode's with λ = 0.1 V⁻¹?

::: solution
1. **Width ratio.** The width ratio scales the copy:
   $$5 \times 20\ \mu\text{A} = 100\ \mu\text{A}$$
2. **Higher drain.** A drain 1 V higher adds a factor of about $1 + \lambda\Delta V = 1.1$:
   $$1.1 \times 100\ \mu\text{A} = 110\ \mu\text{A}$$
3. **In practice.** Ratioed mirrors bias a whole chip's circuits from one reference.

**Answer:** it copies 100 µA, or about 110 µA with its drain 1 V higher.
:::
:::

::: check
given: I = 20 | 50 | 100; r = 2 | 4 | 10
answer: I*r
unit: µA
tolerance: 0.5%

## A mirror's input carries {I} µA and its output transistor has {r} times the W/L. What does the output carry, ignoring λ?

::: right
Right. $I_\text{ref}(W/L)_2/(W/L)_1$ = {answer} µA.
:::

::: misses
- [I/r] The wider transistor carries more current.
- [any] Not yet. Current scales with W/L at the same $V_{GS}$.
:::
:::

::: check
given: l = 0.05 | 0.1 | 0.2; a = 0.4 | 0.6; b = 1 | 2
answer: 100*((1 + l*b)/(1 + l*a) - 1)
tolerance: 0.5%

## A mirror with λ = {l} V⁻¹ has its input at {a} V and its output at {b} V. By what percentage is the copied current too high?

::: right
Right. $(1 + \lambda V_{DS2})/(1 + \lambda V_{DS1}) - 1$ = {answer}%.
:::

::: misses
- [100*l*(b - a)] Close for small λ; the exact ratio is $(1 + \lambda V_{DS2})/(1 + \lambda V_{DS1})$.
- [any] Not yet. Compare the two transistors' $(1 + \lambda V_{DS})$.
:::
:::

::: check
given: l = 0.05 | 0.1 | 0.2; I = 10 | 50 | 200
answer: 1/(l*I*1e-6)/1000
unit: kΩ
tolerance: 0.5%

## A transistor with λ = {l} V⁻¹ carries {I} µA. What's its output resistance?

::: right
Right. $1/(\lambda I_D)$ = {answer} kΩ.
:::

::: misses
- [any] Not yet. $r_o = 1/(\lambda I_D)$.
:::
:::

::: check
given: d = 0.1 | 0.15 | 0.2; v = 0.15 | 0.25 | 0.3
answer: (d/v)*sqrt(1 - d^2/(4*v^2))
tolerance: 0.5%

## A MOS differential pair is biased at {v} V of overdrive. What fraction of its tail current does a {d} V input difference steer?

::: right
Right. $(\Delta V/V_{OV})\sqrt{1 - \Delta V^2/4V_{OV}^2}$ = {answer}.
:::

::: misses
- [d/v] That's the small-signal estimate; the exact expression bends over.
- [any] Not yet. The large-signal pair equation.
:::
:::

::: check
kind: parts
given: l = 0.05 | 0.1 | 0.2; d = 0.5 | 1 | 2

## A current mirror has λ = {l} V⁻¹, and its output sits {d} V above its diode-connected side.

::: part
answer: (1 + l*d)*100 - 100
unit: %
tolerance: 1%

### About how far off is the copy (simple estimate $\lambda\Delta V$)?

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

::: part
answer: 1/(l*100e-6)/1000
unit: kΩ
tolerance: 0.5%

### What is its output resistance at 100 µA?

::: misses
- [any] $1/(\lambda I)$.
:::
:::
:::

::: check
kind: parts
given: g = 0.5 | 1 | 2; r = 50 | 100 | 200

## A cascode puts a transistor with $g_m$ = {g} mS on top of a current source of {r} kΩ, both with $r_o$ = {r} kΩ.

::: part
answer: g*r*r/1000
unit: MΩ
tolerance: 0.5%

### About what output resistance results ($g_mr_o^2$)?

::: misses
- [any] $g_mr_o \times r_o$.
:::
:::

::: part
answer: g*r
tolerance: 0.5%

### By what factor did the cascode raise it?

::: misses
- [any] $g_mr_o$.
:::
:::
:::

::: check
kind: parts
given: I = 50 | 100 | 400; v = 0.15 | 0.2 | 0.3; l = 0.05 | 0.1

## A MOS differential pair has {I} µA of tail current and {v} V of overdrive, with a mirror load and λ = {l} V⁻¹.

::: part
answer: 2*(I/2)/v/1000
unit: mS
tolerance: 0.5%

### What is each transistor's $g_m$?

::: misses
- [2*I/v/1000] Each side carries half the tail current.
- [any] $2I_D/V_{ov}$ with $I_D = I/2$.
:::
:::

::: part
answer: 2*(I/2)/v*1e-6*(1/(l*I/2*1e-6))/2
tolerance: 0.5%

### What is its gain, $g_m(r_{o}\parallel r_{o})$?

::: misses
- [any] $g_m \times r_o/2$.
:::
:::
:::

::: check
kind: parts
given: r = 2 | 5 | 10; i = 10 | 20 | 100

## A mirror's output transistor is {r} times as wide as its diode-connected one, with {i} µA of reference current.

::: part
answer: r*i
unit: µA
tolerance: 0.5%

### What current does it copy?

::: misses
- [any] Width ratio × reference.
:::
:::

::: part
answer: r*i*1.1
unit: µA
tolerance: 0.5%

### And if its drain sits 1 V higher, with λ = 0.1 V⁻¹?

::: misses
- [any] × $(1 + \lambda\Delta V)$.
:::
:::
:::

::: explain
## Why does a differential pair ignore a voltage applied equally to both inputs?

::: model
The two transistors share a fixed tail current, so whatever one carries, the other carries the rest. A voltage applied equally to both gates raises both gate voltages together, and since the transistors are matched they must still split the tail current equally, so neither output current changes; the shared source node simply moves up with the inputs. Only a difference between the two gate voltages makes one transistor conduct more than the other, steering current from one side to the other. That's why a differential pair amplifies the difference between its inputs while rejecting interference, such as power-supply noise or a ground shift, that reaches both alike.
:::
:::

::: practice

::: check
given: l = 0.02 | 0.3; a = 0.3 | 0.8; b = 0.9 | 3
answer: 100*((1 + l*b)/(1 + l*a) - 1)
tolerance: 0.5%

## Mirror error, %: λ = {l}, $V_{DS1}$ = {a} V, $V_{DS2}$ = {b} V?

::: misses
- [any] $(1 + \lambda V_2)/(1 + \lambda V_1) - 1$.
:::
:::

::: check
given: l = 0.02 | 0.3; I = 1 | 1000
answer: 1/(l*I*1e-6)/1000
unit: kΩ
tolerance: 0.5%

## $r_o$: λ = {l} V⁻¹, {I} µA?

::: misses
- [any] $1/(\lambda I_D)$.
:::
:::
:::
