C68 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 VT. 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?

Name it

The mirror with every error

A BJT mirror loses two base currents and copies with a different VCE on each side:

IO=Iref1+2/β⋅1+VCE2/VA1+VBE/VA.

The Widlar source

With RE in the output transistor's emitter, the two VBE's differ by IORE:

IORE=VTln⁡IrefIO.

Given IO it gives RE directly; given RE it's transcendental in IO. The left side rises with IO and the right falls, so bisection between 0 and Iref (on a log scale, since IO may be orders of magnitude smaller) finds the one crossing.

The pairs' transfer curves

Bipolar: iC1I=11+e−vid/VT, so a fraction f flows on one side at vid=VTln⁡f1−f.

MOSFET, with VOV=I/K the overdrive at balance:

iD1=I2+IVOV⋅vid21−(vid/2VOV)2

for |vid|≤2VOV; beyond that, one side carries the whole tail.

The OTA

With tail I, input overdrive vOV, and every device's channel-length modulation λ: Ad=gm1(ro2∥ro4)=2λvOV, GBW=gm12πCL and SR=ICL.

Worked example

A BJT mirror with β = 100 and VA = 100 V copies 1 mA, with its output at 5 V. What does it deliver?

Show the solution
  1. Output current. The base currents divide it by 1.02, and the Early effect multiplies it by 1.05/1.007: IO=1mA1.02⋅1.051.007=1.0223mA
  2. 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%.
  3. 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 RE = 1 kΩ. What does it deliver?

Show the solution
  1. Solve for the current. Bisection on IORE−VTln⁡IrefIO gives 69.1 µA.
  2. Check. The resistor drops 69.1 mV, which equals VTln⁡10.0691.
  3. Lesson 3's design, run the other way. For 10 µA, RE=0.02585ln⁡10010μA=11.9kΩ 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
  1. Overdrive at balance. VOV=1mA20mA/V2=0.224V
  2. At 0.1 V of input. iD1=0.5+10.224×0.05×1−0.05=0.718mA
  3. At 0.4 V of input. The input exceeds 2VOV = 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 IO by bisection on a log scale between 10−15 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 iD1 for a MOSFET pair, including full switching beyond 2VOV 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 RE but not when you know IO?

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.