C6 · Lesson 8 · Mirror and differential pair lab
Mirrors, Widlar sources, and the large-signal differential pair, in Python
Lessons 3 to 7 built the integrated amplifier's two essential pieces: the current mirror and the differential pair. Their formulas came with approximations: a mirror with an exact β but an Early effect added by hand, a Widlar equation that can't be solved in closed form, a pair whose small-signal gain says nothing about how far it can swing. In this lab you'll compute them exactly, solve the Widlar source numerically, trace both pairs' full transfer curves, and finish with an OTA's gain, bandwidth and slew rate.
Play
- The curves are the fraction of the tail current carried by one side of a bipolar pair and of a MOSFET pair, against the differential input.
- The bipolar pair switches over within about ±100 mV, set by . The MOSFET pair's range is set by its overdrive: raise it and the curve stretches.
- At the same tail current, which pair has the steeper slope at the center, and which stays linear further?
Predict
A bipolar pair and a MOSFET pair with 0.2 V of overdrive share the same tail current. Which carries 90% of the tail on one side with the smaller input?
The bipolar pair: = 56.8 mV. The MOSFET pair needs 0.18 V. The bipolar pair's higher transconductance per milliamp is the same fact seen from the other side: it switches over a narrower range of input, so it stays linear over a narrower range too.
Name it
The mirror with every error
A BJT mirror loses two base currents and copies with a different on each side:
The Widlar source
With in the output transistor's emitter, the two 's differ by :
Given it gives directly; given it's transcendental in . The left side rises with and the right falls, so bisection between 0 and (on a log scale, since may be orders of magnitude smaller) finds the one crossing.
The pairs' transfer curves
Bipolar: , so a fraction f flows on one side at .
MOSFET, with the overdrive at balance:
for ; beyond that, one side carries the whole tail.
The OTA
With tail I, input overdrive , and every device's channel-length modulation λ: , and .
Worked example
A BJT mirror with β = 100 and = 100 V copies 1 mA, with its output at 5 V. What does it deliver?
Show the solution
- Output current. The base currents divide it by 1.02, and the Early effect multiplies it by 1.05/1.007:
- The two errors. The base currents make it 2% low and the Early effect 4.3% high, so the output errs high by 2.2%.
- Why not count on cancelling. The two errors depend on different things (β and the output voltage), so a design can't rely on them cancelling.
Answer the mirror delivers 1.0223 mA, 2.2% high.
Worked example
A Widlar source has a 1 mA reference and = 1 kΩ. What does it deliver?
Show the solution
- Solve for the current. Bisection on gives 69.1 µA.
- Check. The resistor drops 69.1 mV, which equals .
- Lesson 3's design, run the other way. For 10 µA, and the solver recovers exactly 10 µA from that resistor.
Answer the Widlar source delivers 69.1 µA.
Worked example
A MOSFET pair with K = 20 mA/V² and a 1 mA tail gets 0.1 V, then 0.4 V, of differential input. What does one side carry?
Show the solution
- Overdrive at balance.
- At 0.1 V of input.
- At 0.4 V of input. The input exceeds = 0.316 V, so that side carries the whole 1 mA and the other is off.
Answer one side carries 0.718 mA at 0.1 V of input, and the whole 1 mA at 0.4 V.
Check
Step 1. Write mirror_out(Iref, beta, VA, VCE2, VBE=0.7) returning the output of a BJT mirror with base-current and Early-effect errors.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write widlar(Iref, RE, VT=0.02585) returning by bisection on a log scale between A and Iref.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write bjt_pair(vid, I, VT=0.02585) returning (ic1, ic2), and vid_for(f, VT=0.02585) returning the input that puts a fraction f of the tail on one side.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write mos_pair(vid, I, K) returning for a MOSFET pair, including full switching beyond in either direction.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write ota(I, vov, lam, CL) returning (Ad, GBW, SR) for a five-transistor OTA: gain, gain-bandwidth in Hz, and slew rate in V/s.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What differential input puts a fraction 0.8 of a bipolar pair's tail on one side?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
Check
What emitter resistor makes a Widlar source deliver 5 µA from a 1 mA reference?
Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.
Explain why
Why does the Widlar equation need a numerical solution when you know but not when you know ?
The equation sets the resistor's voltage, the output current times the resistance, equal to the thermal voltage times the logarithm of the reference over the output current. If you know the output current, the right side is just a number and dividing by the current gives the resistor. If you know the resistor, the unknown current appears both outside a logarithm and inside it, and no algebra isolates it. But the left side grows steadily with the current while the right side falls, so they cross exactly once, and bisection can close in on that crossing to any precision.
Practice
Keep practicing
3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.