generate_differential_pair
Generate a SPICE .CIR circuit for a BJT long-tailed pair with auto-biased collectors, balanced for differential gain set by supply voltage.
Instructions
Draw a .CIR BJT long-tailed (differential) pair.
Two matched NPN sharing an emitter tail resistor to ground, each collector
loaded by Rc. Single-ended drive on one base; the collectors OUTP
and OUTN swing in antiphase, each with magnitude Rc/(2*re'). The
common-mode base voltage and tail resistor are auto-sized to bias both
collectors near mid-supply, so the pair is balanced and in the active region
— the differential gain then works out near Vcc/(4*Vt), set by the
supply rather than by Rc. Both collectors are labelled; the default
trace plots OUTP (edit it to plot OUTN).
Args:
rc: collector load on each side.
rt: emitter tail resistor; leave unset to auto-size for mid-supply.
vcc: supply voltage.
vb: common-mode base voltage; leave unset for vcc/2.
source: AC drive VALUE for the input base ("AC=1").
analysis: AC, Transient, or DC.
output_node: which collector the default trace plots (OUTP/OUTN).
Returns the .CIR text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rc | No | 10K | |
| rt | No | ||
| vb | No | ||
| vcc | No | 12 | |
| source | No | AC=1 | |
| analysis | No | AC | |
| output_node | No | OUTP |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||