generate_current_mirror
Generate a Micro-Cap .CIR netlist for a BJT current mirror: set Rref for reference current, Rload for mirrored output, and run DC or transient analysis.
Instructions
Draw a .CIR BJT current mirror.
A diode-connected NPN sets a reference current Iref = (Vcc - Vbe)/Rref;
a matched NPN copies it into Rload. The mirrored current is
Iout ≈ Iref (a few % high from the Early effect). It is a DC bias block,
so run a transient/DC and read V(OUTC): the mirrored current is
(Vcc - V(OUTC)) / Rload.
Args:
rref: reference-leg resistor; sets Iref.
rload: load on the output transistor's collector.
vcc: supply voltage.
analysis: transient or dc (it is a bias block, not an AC stage).
output_node: label for the output collector node.
Returns the .CIR text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vcc | No | 12 | |
| rref | No | 11.3K | |
| rload | No | 5K | |
| analysis | No | transient | |
| output_node | No | OUTC |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||