CirSpice

Part types

Every Micro-Cap part type CirSpice knows, generated from the app itself.

User guide / 2. Part types

Each entry says what the part becomes in the simulator and how CirSpice supports it:

  • Supported: the part becomes an ngspice element of the same kind, which simulates it directly.
  • Supported through a model: ngspice has no element that behaves like this part, so CirSpice builds one from ngspice parts. Each was checked on real circuit files against reference results, and the entry gives the measured difference.
  • Not supported yet: a circuit with this part opens, but cannot run until it is supported. The entry says why.

The fields listed are the ones the part's attribute dialog shows (double-click a part to open it). How to type values is in Values and expressions. Under each entry, Technical notes gives the detail of how the part is simulated and what it was checked against.

Supported (45)

Resistor R

A resistor between its Plus and Minus pins. Type its Resistance in ohms: a number with a suffix, such as 10k or 4.7MEG, or a constant expression such as {2*4.7k}. The value applies at the model's nominal temperature, 27 C unless a model or .OPTIONS sets another.

A resistor can name a RES model. The model's R then multiplies the resistance, so a set of resistors that share a model can share a tolerance or a temperature coefficient. TC1 and TC2 on the part give its own linear and quadratic coefficients: at a temperature dT above nominal, the resistance is multiplied by 1 + TC1·dT + TC2·dT2.

Worked example: a voltage divider

  1. Place a Battery with a Voltage of 10, and two resistors of 10k in series from its plus pin to ground. Label the node between them MID with the Text tool.
  2. Pick Transient, set the Maximum Run Time to 1m, add the expression v(MID), and run.
  3. The plot shows a flat 5 V. Turn on Node Voltages in the toolbar to see each net's value on the schematic as well.

Now set TC1 of the lower resistor to 0.004 and the analysis Temperature to 127, 100 degrees above nominal. That resistor becomes 10k × 1.4 = 14k, and v(MID) rises to 10 × 14 / 24, about 5.83 V.

Definition Resistor
SupportSimulated directly: becomes the ngspice element R.
PinsPlus, Minus
Model.MODEL name RES; its R multiplies the part's value, and its TC1 and TC2 set the temperature coefficients.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
RESISTANCEResistanceΩResistance at TNOM; accepts 10k, 4.7meg or an expression
TC1TC11/°CLinear temperature coefficient
TC2TC21/°C²Quadratic temperature coefficient
Technical notes

Resistor

Capacitor C

A capacitor between its Plus and Minus pins. Type its Capacitance in farads: 100n, 4.7u or a constant expression. The suffix F means femto, so write one farad as 1, never 1F.

A capacitor can name a CAP model, whose C multiplies the capacitance; TC1 and TC2 on the part set its temperature coefficients, as for a resistor.

Worked example: an RC low-pass filter

  1. Place a Voltage Source with the value DC 0 AC 1, a resistor of 1k from it to a node labelled OUT, and a capacitor of 100n from OUT to ground.
  2. Pick AC. Set the Frequency Range to 1MEG, 10 (highest first), keep the Log method, and add the expression db(v(OUT)).
  3. Run. The response is flat at 0 dB at low frequencies and falls at 20 dB per decade above the corner.

The corner is at 1 / (2π · 1k · 100n), about 1591.5 Hz. Place cursor A there: the readout shows about −3.01 dB, and ph(v(OUT)) shows −45 degrees.

The same circuit in time

Change the source to PULSE 0 1 0 1n 1n 1m 2m, pick Transient with a run time of 1m, and plot v(OUT). The time constant RC is 100 us: at 100 us the output has reached 63.2% of the step, 0.632 V. Measure Rise_Time from 0.1 to 0.9 V: it gives about 219.7 us, which is RC × ln 9.

Definition Capacitor
SupportSimulated directly: becomes the ngspice element C.
PinsPlus, Minus
Model.MODEL name CAP; its C multiplies the part's value, and its TC1 and TC2 set the temperature coefficients.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
CAPACITANCECapacitanceFCapacitance; accepts 1n, 4.7u or an expression
TC1TC11/°CLinear temperature coefficient
TC2TC21/°C²Quadratic temperature coefficient
Technical notes

Capacitor

Inductor L

An inductor between its Plus and Minus pins. Type its Inductance in henries: 10u, 4.7m or a constant expression.

An inductor can name an IND model, whose L multiplies the inductance; TC1 and TC2 on the part set its temperature coefficients. To couple inductors magnetically, add a coupling part (K) that names them; for a two-winding transformer there is also a Transformer part.

Worked example: an RL step

  1. Place a Voltage Source with the value PULSE 0 1 0 1n 1n 1m 2m, an inductor of 10m from it to a node labelled OUT, and a resistor of 100 from OUT to ground.
  2. Pick Transient with a run time of 1m, plot v(OUT) and i(L1) (use your inductor's name), and run.

The time constant L/R is 100 us. The current rises towards 1 V / 100 = 10 mA and reaches 6.32 mA at 100 us; v(OUT), across the resistor, follows it from 0 to 1 V.

Definition Inductor
SupportSimulated directly: becomes the ngspice element L.
PinsPlus, Minus
Model.MODEL name IND; its L multiplies the part's value, and its TC1 and TC2 set the temperature coefficients.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
INDUCTANCEInductanceHInductance; accepts 1u, 4.7m or an expression
TC1TC11/°CLinear temperature coefficient
TC2TC21/°C²Quadratic temperature coefficient
Technical notes

Inductor

Voltage Source V

An independent voltage source between its Plus and Minus pins, written for ngspice as a SPICE source. Its Source value holds, in any order, its DC value, its AC value and one waveform in time: DC 5, AC 1, SIN(0 1 1k), PULSE(0 5 0 1n 1n 5u 10u), EXP, SFFM, GAUSSIAN or PWL. Every form is described in Source waveforms.

Each analysis takes the part it needs: the operating point and DC take the DC value, AC takes the AC value, and a transient takes the waveform, or the DC value when there is none.

Examples

5                        5 V in every analysis
DC 0 AC 1                0 V bias, 1 V in an AC analysis
SIN(0 1 1k)              a 1 V peak, 1 kHz sine
DC 2.5 AC 1 SIN(2.5 1 1k) the same sine on 2.5 V, usable in all three analyses
PULSE(0 5 0 10n 10n 5u 10u)  a 100 kHz, 5 V square wave with 10 ns edges
PWL(0 0 1m 5 2m 5 3m 0)  a ramp up, a hold, and a ramp down
Definition VSpice
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUESourceThe waveform as the file holds it
Technical notes

Independent voltage source

Current Source I

An independent current source between its Plus and Minus pins, with the same value forms as the voltage source: see Source waveforms.

Mind its direction: a positive current flows through the source from its plus pin to its minus pin, so it pushes current out of the minus pin into the circuit.

Worked example

Connect a Current Source of DC 1m with its plus pin on ground and its minus pin to a node labelled N, and a resistor of 1k from N to ground. The 1 mA flows out of the minus pin into the resistor, so v(N) is +1 V. Turn the source round and v(N) becomes −1 V.

Definition ISpice
SupportSimulated directly: becomes the ngspice element I.
PinsPlus, Minus

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUESourceThe waveform as the file holds it
Technical notes

Independent current source. SPICE direction: current flows through it from + to -, so it pushes current out of - into the circuit.

Diode D

A diode from its Anode to its Cathode. Its behaviour comes from a D model named by its Model attribute, such as 1N4148: from a .MODEL on the circuit's text page, or from a library (see Models and libraries). CirSpice simulates the standard SPICE diode, model LEVEL 1.

Area multiplies the model's currents, M puts that many identical diodes in parallel, and Off starts the operating-point search with the diode off, which can help a circuit with more than one stable state.

Worked example: a half-wave rectifier

  1. On the text page, define a model: .MODEL DSIG D (IS=1e-14 N=1.8 RS=0.5).
  2. Place a Voltage Source with the value SIN(0 10 50) (10 V peak, 50 Hz), a diode with Model DSIG from it to a node labelled OUT, and a resistor of 1k from OUT to ground.
  3. Pick Transient with a run time of 60m (three cycles) and a Maximum Time Step of 100u, plot v(OUT) and the source's voltage, and run.

The output follows the positive half-cycles, a diode drop below the input's 10 V peak, and stays at 0 V during the negative ones. Add a capacitor of 100u across the resistor and run again: the output now holds near the peak between cycles, with a ripple that falls as the capacitor grows.

Definition Diode
SupportSimulated directly: becomes the ngspice element D.
PinsAnode, Cathode
Model.MODEL name D, written for ngspice as a .model of type D. LEVEL 1. Not supported yet in it: TIKF, TBV1, TBV2, TRS1, TRS2.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
AREAAreaA multiplier on the model's currents; a number, no unit, 1 when empty
OFFOffStart the first operating-point iteration with the part off
ICIC (Vd)VInitial junction voltage; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
MMultiplierNumber of devices in parallel; no unit
Technical notes

Diode, model by name (LEVEL 1, SPICE2G). Verified against reference results on FFT7.cir, as the rectifier there, at 27 C. Away from TNOM its junction capacitance moves as ngspice's does (VJ from silicon's EG(T), CJO(T) = CJO (1 + M (4e-4 dT + 1 - VJ(T)/VJ)), measured at 27, 50 and 100 C); its breakdown away from TNOM keeps Micro-Cap's knee fixed at TNOM and moves only the exponential, BV written for the run's temperature. The model's RL, Micro-Cap's leakage resistance, is netlisted across the junction, inside RS: verified on the authored AUTH_OPT_A_RL.cir (RL 1k, RS 100), and on Buck Converter.cir (RL 183.18K) to 0.0162% on v(Out). RL with an area or M is refused (the reader does not take a diode area yet).

Function Voltage Source B

A voltage source whose output, between Plus and Minus, is a Formula evaluated at every step of the run. The formula can use time T, node voltages, the current of a voltage source or plain resistor, arithmetic, comparisons, logic and a set of functions, all listed in Formulas that change during a run. A name outside that set, such as SQRT or ^, is refused with a message.

TABLE(x, x1,y1, x2,y2, ...) interpolates linearly between the points and holds the end values outside them. DELAY(x, td) delays x by a fixed time td.

Worked example: a soft limiter

  1. Drive a node labelled IN from a Voltage Source SIN(0 5 1k).
  2. Place a Function Voltage Source from a node labelled OUT to ground with the formula 2*TANH(V(IN)/2).
  3. Pick Transient with a run time of 2m, plot v(IN) and v(OUT), and run.

For small inputs the output follows the input; as the input grows the output rounds off towards ±2 V. At the 5 V peak it reaches 2 × tanh(2.5), about 1.97 V.

Worked example: a comparator

The formula IF(V(IN)>2.5, 5, 0) gives 5 V while IN is above 2.5 V and 0 V otherwise. The edge is as sharp as the run's time step allows; set a Maximum Time Step to place it precisely.

Definition NFV
SupportSimulated directly: becomes the ngspice element B.
PinsPlus, Minus

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUEFormulaAn expression of the circuit's voltages, currents and time
Technical notes

Behavioral voltage source, output a formula: T, PI, V(node), V(node,node), I(part) of a voltage source or plain resistor, numbers with SPICE suffixes, + - * /, SIN, COS, EXP, ABS, TANH, LN, LOG and LOG10 (base 10), U, MIN, MAX, LIMIT, IF, TABLE(x, x1,y1...) (linear, held at the end values), comparisons and AND, OR, NOT, after enabled.DEFINEs. DELAY(x, td), td a positive constant, is x through an ideal line of delay td ended in its Z0, verified on monostable_test.cir's Monostable macro (every column within tolerance); like the ideal line it can lose a pulse narrower than the run's step. A comparison or logic operand must be a single term (that precedence is open); SQRT, POW, ^ and other names are refused. Verified against reference results on FFT8.cir, on PWM Modulator.cir for IF and a comparison (edges within 0.08 us), and on Smoothing_Table_NOFP.cir for TABLE() and LIMIT(). A PSpice E with TABLE or VALUE in a text area's.SPICE block reads as one too (4.2), its nodes joined by label; verified there on OUT2, RMS 0.0007% of peak to peak.

Function Current Source nfi

A current source whose current is a Formula, with the same functions as the Function Voltage Source (see Formulas). As with any current source, a positive current flows through it from Plus to Minus, so it leaves the Minus pin into the circuit.

Worked example: a constant-power load

To draw 10 W from a node labelled VOUT, place a Function Current Source with its Plus pin on VOUT and its Minus pin on ground, and the formula 10/V(VOUT). The current falls as the voltage rises, keeping the product at 10 W. Mind the division: if VOUT can reach 0 V the formula has no value there, so write 10/(V(VOUT)+1m) or limit it with LIMIT.

Definition NFI
SupportSimulated directly: becomes the ngspice element B.
PinsPlus, Minus

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUEFormulaAn expression of the circuit's voltages, currents and time
Technical notes

Behavioral current source (NFI), the current a formula of the same subset as NFV's, flowing through it from Plus to Minus as ISpice's (a hypothesis in 4.21). Verified against reference results on Non Damped RLC.CIR (a constant-power load 60/(V(VOUT)+1)): 0.45% of peak-to-peak on a marginally stable circuit. A PSpice G with TABLE or VALUE in a text area's.SPICE block reads as one too (4.2), current from + to - by SPICE convention; no reference run checks that form yet.

NMOS M

An N-channel MOSFET with Drain, Gate, Source and Body pins. Its behaviour comes from an NMOS model named by its Model attribute. The model's LEVEL picks the equations: 1, 2 and 3 for the classic SPICE models, 8 and 49 for BSIM3 version 3.3, and 14 and 54 for BSIM4 version 4.8. A BSIM model of another version is refused with a message rather than run with the wrong equations.

W and L set the channel's width and length; AD, AS, PD, PS, NRD and NRS set the drain and source junctions and their resistances. M puts that many identical transistors in parallel. Plot its currents and voltages with lead pairs, such as ID(M1) and VGS(M1).

Worked example: a low-side switch

  1. On the text page, define a model: .MODEL NSW NMOS (LEVEL=1 VTO=2 KP=0.5).
  2. Place an NMOS with Model NSW, W 100u and L 100u, its source and body to ground. Connect a resistor of 100 from a 12 V Battery to its drain, labelled D.
  3. Drive the gate from a Voltage Source with the value PULSE 0 10 0 1u 1u 50u 100u.
  4. Pick Transient with a run time of 200u, plot v(D) and the gate voltage, and run.

While the gate is at 0 V, below the 2 V threshold, the transistor is off and the drain sits at 12 V. When the gate goes to 10 V it turns on and pulls the drain down to a fraction of a volt, set by the 100 ohm load against the channel's on resistance.

Definition NMOS
SupportSimulated directly: becomes the ngspice element M.
PinsDrain, Gate, Source, Body
Model.MODEL name NMOS, written for ngspice as a .model of type NMOS. LEVEL 1, 2, 3, 8, 14, 49, 54.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
MMultiplierNumber of devices in parallel; no unit
LLengthmChannel length
WWidthmChannel width
ADDrain aream²Area of the drain diffusion
ASSource aream²Area of the source diffusion
PDDrain perimetermPerimeter of the drain diffusion
PSSource perimetermPerimeter of the source diffusion
NRDDrain squaresSquares of drain diffusion; no unit
NRSSource squaresSquares of source diffusion; no unit
NRGGate squaresSquares of gate material; no unit
NRBBulk squaresSquares of bulk material; no unit
OFFOffStart the first operating-point iteration with the part off
ICIC (Vds,Vgs,Vbs)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
Technical notes

N-channel MOSFET with a separate body pin, model by name (LEVEL 1, 2, 3, 8 and 49 for BSIM3v3.3, or 14 and 54 for BSIM4: the same numbers name the same model families in Micro-Cap and in ngspice's manual; that the equations agree is not verified, and a BSIM3 VERSION other than 3.3 or a BSIM4 VERSION other than 4.8, Micro-Cap's, is refused until a probe shows how Micro-Cap reads another). CMOS_COUNTER.CIR (BSIM3, through its macros' caller models) verifies parse and netlist only: its stepped tables are not compared yet. Level 1 verified against reference results on the authored AUTH_NMOS.cir (drain load, gate ramp), 0.026% of peak-to-peak: KP, VTO, W and L with the body at the source; LAMBDA, body effect and capacitances are not exercised. OPT_CURVES_BSIM4.cir (BSIM4) verifies parse and netlist only: both its plotted nodes are source-held, and ngspice does not find its operating point (known failure, #14). At levels 1 to 3 the model's RG and RB are resistors from the gate and bulk pins to internal nodes, and RD and RS beside an RDS from the drain and source pins, M dividing them, as RM Figure 26-20 draws them: read from the figure, not yet verified against reference results. An RD or RS of 0 beside a non-zero RSH is refused: ngspice's model leaves the channel unconnected there. An RSH standing in for RD or RS beside an RDS, and a gate resistance from RSH and the instance's NRG, are refused until written.

PMOS pmos

A P-channel MOSFET: the NMOS's equations with every polarity reversed, at the same LEVELs. Its model is a PMOS model, and its pins and fields are the NMOS's. In normal use its source and body sit at the highest voltage, and it turns on when the gate goes below the source by more than the threshold.

Worked example: a high-side switch

Mirror the NMOS's low-side switch: .MODEL PSW PMOS (LEVEL=1 VTO=-2 KP=0.5), source and body at 12 V, the 100 ohm load from the drain to ground, and the gate driven by PULSE 12 2 0 1u 1u 50u 100u. The load sees about 12 V while the gate is low and none while it is high.

Definition PMOS
SupportSimulated directly: becomes the ngspice element M.
PinsDrain, Gate, Source, Body
Model.MODEL name PMOS, written for ngspice as a .model of type PMOS. LEVEL 1, 2, 3, 8, 14, 49, 54.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
MMultiplierNumber of devices in parallel; no unit
LLengthmChannel length
WWidthmChannel width
ADDrain aream²Area of the drain diffusion
ASSource aream²Area of the source diffusion
PDDrain perimetermPerimeter of the drain diffusion
PSSource perimetermPerimeter of the source diffusion
NRDDrain squaresSquares of drain diffusion; no unit
NRSSource squaresSquares of source diffusion; no unit
NRGGate squaresSquares of gate material; no unit
NRBBulk squaresSquares of bulk material; no unit
OFFOffStart the first operating-point iteration with the part off
ICIC (Vds,Vgs,Vbs)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
Technical notes

P-channel MOSFET with a separate body pin, model by name, the NMOS levels: NMOS's equations with the polarity reversed, as in SPICE (a hypothesis in the spec). Its compdef places the pins as NMOS's. Not yet verified against reference results: on Ring_counter.cir (17 PMOS and 17 NMOS, level 2) the swing matches but the oscillation period is about 5% longer in ngspice, for both polarities alike (known failure in the manifest). The DPMOS symbol (gate at (0,1)) is refused, as DNMOS. RG, RB, RD, RS and RDS as for NMOS.

NJFET J

An N-channel junction FET with Drain, Gate and Source pins. Its behaviour comes from an NJF model named by its Model attribute, simulated with the standard SPICE JFET equations: VTO is the pinch-off voltage (negative for the usual depletion device), BETA the transconductance factor and LAMBDA the channel-length modulation.

Area multiplies the model's currents, M puts devices in parallel, and Off starts the operating-point search with the device off. Some of Micro-Cap's extra JFET parameters have no ngspice counterpart and are refused when set: see the technical notes.

Worked example: drain current against gate voltage

  1. On the text page: .MODEL JN NJF (VTO=-2 BETA=1m LAMBDA=0).
  2. Place an NJFET with Model JN, source to ground, drain to a 10 V Battery, gate to a Voltage Source named VG with the value DC 0.
  3. Pick DC, sweep VG with the range 0, -2.5, 0.05, plot ID(J1), and run.

In saturation the drain current is BETA × (VGS − VTO)2: 4 mA at VGS = 0, 1 mA at −1 V, and none below −2 V.

Definition NJFET
SupportSimulated directly: becomes the ngspice element J.
PinsDrain, Gate, Source
Model.MODEL name NJF, written for ngspice as a .model of type NJF. LEVEL 1. Not supported yet in it: ISR, NR, ALPHA, VK, VTOTC, BETATCE.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
AREAAreaA multiplier on the model's currents; a number, no unit, 1 when empty
OFFOffStart the first operating-point iteration with the part off
ICIC (Vds,Vgs)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
MMultiplierNumber of devices in parallel; no unit
Technical notes

N-channel JFET, model by name: SPICE 2G.6 Shichman-Hodges, as ngspice's level-1 J. Micro-Cap's PSpice extensions ISR, NR, ALPHA, VK, VTOTC and BETATCE are refused (ngspice's J lacks them), and M and XTI pass only at their defaults. Verified against reference results on Oscillators/Armstrong.cir (2N3368, VTO=0, RS and the junction capacitances in play): same oscillation period to 6 digits, swing levels within 0.02% of peak-to-peak. The authored AUTH_NJFET (a static drain-load sweep) is still planned.

PJFET pjfet

A P-channel junction FET: the NJFET's equations with every polarity reversed. Its model is a PJF model, with VTO positive for the usual depletion device, and its pins and fields are the NJFET's. Mirror the NJFET example with .MODEL JP PJF (VTO=2 BETA=1m), a −10 V drain supply and the gate swept from 0 to 2.5 V.

Definition PJFET
SupportSimulated directly: becomes the ngspice element J.
PinsDrain, Gate, Source
Model.MODEL name PJF, written for ngspice as a .model of type PJF. LEVEL 1. Not supported yet in it: ISR, NR, ALPHA, VK, VTOTC, BETATCE.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
AREAAreaA multiplier on the model's currents; a number, no unit, 1 when empty
OFFOffStart the first operating-point iteration with the part off
ICIC (Vds,Vgs)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
MMultiplierNumber of devices in parallel; no unit
Technical notes

P-channel JFET, model by name: NJF with every polarity reversed and VTO negative for depletion, as ngspice's PJF (supported in the spec). The NJFET's pins at the same positions. Not yet verified against reference results.

NPN Q

An NPN bipolar transistor with Collector, Base and Emitter pins. Its behaviour comes from an NPN model named by its Model attribute, such as 2N3904, simulated with the standard Gummel-Poon equations (model LEVEL 1).

Area multiplies the model's currents, M puts that many identical transistors in parallel, and Off starts the operating-point search with the transistor off.

In a plot, a transistor's lead quantities are written with its name: IC(Q1), IB(Q1) and IE(Q1) for the currents into its leads, VBE(Q1) or VCE(Q1) for the voltage between two leads, and VB(Q1) for one lead's voltage.

Worked example: output curves

  1. On the text page, define a model: .MODEL QGEN NPN (IS=1e-14 BF=200 VAF=100).
  2. Place an NPN with Model QGEN, its emitter to ground. Drive its base from a Current Source named I1, and its collector from a Voltage Source named V1, each with the value DC 0.
  3. Pick DC. Set Variable 1 to V1 with the range 10, 0, 0.05; set Variable 2 Method to Linear, Variable 2 to I1 with the range 50u, 10u, 10u. Plot IC(Q1).
  4. Run. CirSpice draws one curve per base current, each labelled with its value.

Above about 0.2 V each curve flattens near BF times the base current (about 2 mA for 10 uA), and rises slowly with VCE because of the Early voltage VAF. Mind the current source's direction: a positive value pushes current out of its minus pin, so connect the minus pin to the base.

Definition NPN
SupportSimulated directly: becomes the ngspice element Q.
PinsCollector, Base, Emitter
Model.MODEL name NPN, written for ngspice as a .model of type NPN. LEVEL 1. Not supported yet in it: QUASIMOD, GAMMA, RCO, VO.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
AREAAreaA multiplier on the model's currents; a number, no unit, 1 when empty
OFFOffStart the first operating-point iteration with the part off
ICIC (Vbe,Vce)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
MMultiplierNumber of devices in parallel; no unit
Technical notes

NPN bipolar transistor, three pins, Gummel-Poon model by name (LEVEL 1). Verified against reference results on curves.cir: the base voltage at 1 mA base current (VBE), the one plotted value the model sets.

PNP pnp

A PNP bipolar transistor: the NPN's equations with every polarity reversed. Its model is a PNP model, and its fields and plot quantities (IC(Q1), VCE(Q1) and so on) are the NPN's. Its symbol puts the emitter at the top, where an NPN has its collector, and in normal use its emitter sits above its base in voltage.

Worked example

Take the NPN's output-curves example and mirror it: a PNP with .MODEL QGENP PNP (IS=1e-14 BF=200 VAF=100), V1 swept from -10 to 0, and the base current source turned round. The curves are the NPN's with the signs of every current and voltage reversed.

Definition PNP
SupportSimulated directly: becomes the ngspice element Q.
PinsCollector, Base, Emitter
Model.MODEL name PNP, written for ngspice as a .model of type PNP. LEVEL 1. Not supported yet in it: QUASIMOD, GAMMA, RCO, VO.
Model.MODEL name LPNP, written for ngspice as a .model of type PNP. LEVEL 1. Not supported yet in it: QUASIMOD, GAMMA, RCO, VO.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
AREAAreaA multiplier on the model's currents; a number, no unit, 1 when empty
OFFOffStart the first operating-point iteration with the part off
ICIC (Vbe,Vce)VInitial voltages; kept in the file; a run with the operating point on does not apply it, and one with it off refuses
MMultiplierNumber of devices in parallel; no unit
Technical notes

PNP bipolar transistor, three pins, Gummel-Poon model by name (LEVEL 1), NPN's equations with the polarity reversed. Its compdef puts the emitter on top, NPN's collector place. Verified against reference results on ALLISON_PREAMP.CIR (two 2N4403s in composite pairs with NPNs, ahead of an opamp), 0.0022% of peak-to-peak.

Coupling K

Couples two or more inductors magnetically. Its Inductors attribute names them by their part names, separated by spaces, and its Coupling is the coupling coefficient k, from 0 to 1. The Plus pin of each inductor is its dotted end. CirSpice also adds the very large resistor Micro-Cap places between the coupled inductors, so a winding is never left floating.

With a CORE model named in its Model attribute, the coupling becomes one nonlinear magnetic core with saturation and hysteresis, each inductor's value then being its number of turns.

Worked example: a 1:2 transformer from two inductors

  1. Place two inductors, L1 of 1m and L2 of 4m, each with its Minus pin on ground.
  2. Place a coupling part with Inductors L1 L2 and Coupling 0.999.
  3. Drive L1 from a Voltage Source SIN(0 1 10k) through a 1 ohm resistor, load L2 with 10k, and run a transient of 500u.

The turns ratio is the square root of the inductance ratio, 2, so the secondary shows a sine of about 2 V peak, in phase with the primary because both Plus pins are dotted ends.

Definition K
SupportSimulated directly: becomes the ngspice element K.
Model.MODEL name CORE.

Fields in its attribute dialog

AttributeLabelUnitWhat it is
COUPLINGCouplingCoupling coefficient, 0 to 1; no unit
Technical notes

Mutual inductance between inductors named by designator, coupling k (linear; each inductor's Plus pin is its dotted end), plus Micro-Cap's 1/GMIN resistor (1E12) between the coupled inductors' Plus pins. Verified against reference results on AUTH_K.cir. A K with a CORE MODEL is one nonlinear core, the MC_CORE shim: the RM's printed Jiles-Atherton equations with the irreversible term clamped where (Ma - M) and the sign of dH/dt differ, M from 0, the gap a series reluctance (H = (sum N I - M GAP) / (PATH + GAP)), the windings (1 to 4) N AREA dB/dt with each inductor's value its turns, CGS converted to SI, integrated by ngspice in B-sources around two 1 F capacitors. Verified against reference results on the authored AUTH_CORE1, AUTH_CORE1_DEF, AUTH_CORE1_FRAC (10.5 turns), AUTH_CORE1R (a minor loop) and AUTH_CORE1G01, AUTH_CORE1G1 (gaps 0.01 and 0.1 cm), runs 20261108T062130Z-eab595 to 20261108T063534Z-a6d77b: B within 0.020 to 0.062% of its peak-to-peak, H and the winding current within 0.006%, the winding voltage within 0.21% (2.2% and 0.74% on the two gapped files' 0.3 mV and 32 uV swings, 0.33% on the minor loop). COUPLING scales each winding's voltage and nothing else (item 2). On CORE3.cir (three windings at coupling.999) the transient is within 0.23%. AC on an unbiased core (item 4, as corrected in re-notes f1f2288) is ordinary reciprocal mutual coupling, the transient's coupling rule not applying: each winding its vacuum inductance mu0 N^2 AREA / PATH, coupled pairwise by COUPLING through ngspice's K, as Micro-Cap's (CORE3's AC within 0.001 dB to 1 GHz). A core takes the fine step of stop/4096. Royer_Oscillator.cir (four windings on the library's 3B1, coupling.98), started from zero with the operating point off, starts oscillating at 17.5 us where Micro-Cap starts at 12.7 us and runs at 13.22 us against 13.4 us, so a core in such a start is refused. Refused until measured: a core biased at the operating point (the run's guard reads each core's field there, item 3), a DC sweep, AC on a gapped core and AC with the operating point off.

Battery battery

A battery: a constant voltage between its Plus and Minus pins, the plus pin the higher. Type its Voltage as a number or a constant expression: 9, 1.5 or {VCC} with a .PARAM VCC=5 on the text page.

It has no AC value and no waveform: for a source that changes in time, or that drives an AC analysis, use a Voltage Source.

Example

A battery of 12 with its minus pin on ground holds its plus pin at 12 V in every analysis. Two batteries, 15 and 15, in series with their junction on ground give the ±15 V supplies an opamp circuit needs.

Definition Battery
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUEVoltageVThe battery's voltage; accepts 9, 1.5 or an expression
Technical notes

Battery: a constant DC voltage source. A LOT tolerance in its value is dropped (Monte Carlo only). Verified against reference results on opt1a.cir, and on AUTH_SOURCES.cir charging an RC from 0 V with Operating Point off (polarity from the Plus pin).

Pulse Source pulse

The Pulse Source, between its Plus and Minus pins. It takes its settings from a PUL model: the levels VZERO and VONE, and five times, P1 to P5, each counted from the start of the period. The rising edge runs from P1 to P2, the pulse holds until P3, the falling edge runs from P3 to P4, and the whole repeats every P5.

Unset, VZERO is 0, VONE is 5 V, and P1 to P5 are 100n, 110n, 500n, 510n and 1u: a 1 MHz pulse.

An edge of zero length, a true step in Micro-Cap, is given a length of a billionth of the period, since ngspice cannot take a zero edge. In an AC analysis the source is 1 V at phase 0.

Example

.MODEL CLK PUL (VZERO=0 VONE=5 P1=0 P2=10n P3=5u P4=5.01u P5=10u)

This is a 0 to 5 V square wave at 100 kHz with 10 ns edges: the period P5 is 10 us. Start rising at P1 = 0 and finish at P2 = 10n, start falling at P3 = 5u and finish at P4 = 5.01u. The equivalent Voltage Source value is PULSE(0 5 0 10n 10n 4.99u 10u): SPICE gives the width between the edges, where Micro-Cap gives the times of the edges.

Definition Pulse source
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus
Model.MODEL name PUL.
Technical notes

Pulse source: a PUL model's absolute edge times P1 to P5 written as a SPICE PULSE (delay P1, rise P2 - P1, width P3 - P2, fall P4 - P3, period P5). A zero-length edge, a true step in Micro-Cap, is written as a billionth of the period, since ngspice would replace a zero edge with TSTEP. Verified against reference results on CARLO2.cir (all defaults), opt4.cir (zero-length edges), FFT4.cir (a 1E9 V, 1 ns impulse) and AUTH_SOURCES.cir (every parameter non-default). In AC it is a 1 V source, phase 0, verified on TL1.cir's AC run (0 dB exact, 0.093 degrees RMS).

Transmission Line tline

A transmission line with ports A (pins A+ and A−) and B (pins B+ and B−). The ideal, lossless line takes a characteristic impedance Z0 and either a delay TD or a frequency F with the line's length in wavelengths NL, from its Value or a TRN model. A lossy line, with resistance, inductance, conductance and capacitance per unit length and a length LEN, is also read; see its technical notes for how far it is checked.

Worked example: a reflection

  1. Place a line with Z0=50 TD=100n. Drive port A from a Voltage Source PULSE(0 2 0 1n 1n 20n 1) through a 50 ohm resistor, and leave port B open.
  2. Run a transient of 500n with a Maximum Time Step of 1n, plotting the voltage at port A and at port B.

The 50 ohm source and the line divide the 2 V step, so 1 V enters the line. It reaches the open end 100 ns later, doubles to 2 V there, and the reflection arrives back at port A after another 100 ns.

Definition Tline
SupportSimulated directly: becomes the ngspice element T.
PinsA+, A-, B+, B-
Model.MODEL name TRN.
Technical notes

Tline, ideal (lossless): Z0 (or ZO) with TD, or with F and NL, from VALUE over the TRN model, as ngspice's T element. Verified against reference results on TL1.cir (Z0=50 TD=100N, series-terminated at the source, open far end), 0.071% of peak-to-peak; the F and NL form is untested. A lossy line (R, L, G, C per unit length and LEN, the SPICE3 convolution method) is ngspice's LTRA, an O element with its own model; only RLC, RC, RG and LC lines, as Micro-Cap takes. The lossy line is not yet verified against reference results in transient. In AC it is wrong: ngspice's LTRA gives a frequency-independent response where Micro-Cap follows the exact lossy-line transfer (LTRA3.cir AC, a known failure in test:corpus); the ideal line matches in AC (TL1.cir: 0 dB exact, phase 0.093 degrees RMS). A line whose TD is written as an expression is refused for now: ngspice's line keeps what it delays at its own time points and can drop pulses narrower than a step, which the CD's RECTIFIER_45 trigger pulses showed (50% off at the file's step, matched at a tenth of it).

Voltage-Controlled Source vofv

An ideal, linear voltage-controlled voltage source: its output is a voltage between Plus Output and Minus Output, equal to its Value, the gain, times the voltage between Plus Input and Minus Input. It has no output resistance and no limits. CirSpice writes it as a SPICE E source.

Example

With a gain of 10, a 2 V input gives an output of 20 V across a load of any size. For a gain that depends on the input, use a Function Voltage or Current Source, or a Table Source.

Definition VofV
SupportSimulated directly: becomes the ngspice element E.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

VofV: an ideal linear voltage-controlled voltage source, V(Plus Output, Minus Output) = VALUE x V(Plus Input, Minus Input), with no output resistance or limits, as SPICE E. Verified against reference results on Regulator1_PLOT.cir (a gain-10k error amplifier that regulates only with this polarity): the load voltage within 0.003%, the worst column 0.017%.

Voltage-Controlled Current Source iofv

An ideal, linear voltage-controlled current source: its output is a current that flows through it from Plus Output to Minus Output, equal to its Value, the gain, times the voltage between Plus Input and Minus Input. It has no output resistance and no limits. CirSpice writes it as a SPICE G source.

Example

With a gain of 10, a 2 V input gives an output of 20 A, forced through whatever load is connected. For a gain that depends on the input, use a Function Voltage or Current Source, or a Table Source.

Definition IofV
SupportSimulated directly: becomes the ngspice element G.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

IofV: an ideal linear voltage-controlled current source, a current VALUE x V(Plus Input, Minus Input) through the source from Plus Output to Minus Output, with no output resistance or limits, as SPICE G. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

Current-Controlled Voltage Source vofi

An ideal, linear current-controlled voltage source: its output is a voltage between Plus Output and Minus Output, equal to its Value, the gain, times the current flowing into Plus Input and out of Minus Input (the input pins are joined by a 0 V source that measures it). It has no output resistance and no limits. CirSpice writes it as a SPICE H source.

Example

With a gain of 10, a 2 V input gives an output of 20 V across a load of any size. For a gain that depends on the input, use a Function Voltage or Current Source, or a Table Source.

Definition VofI
SupportSimulated directly: becomes the ngspice element H.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

VofI: an ideal linear current-controlled voltage source, V(Plus Output, Minus Output) = VALUE x the current into Plus Input, read through a 0 V source from Plus to Minus Input, as SPICE H. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

Current-Controlled Current Source iofi

An ideal, linear current-controlled current source: its output is a current that flows through it from Plus Output to Minus Output, equal to its Value, the gain, times the current flowing into Plus Input and out of Minus Input (the input pins are joined by a 0 V source that measures it). It has no output resistance and no limits. CirSpice writes it as a SPICE F source.

Example

With a gain of 10, a 2 V input gives an output of 20 A, forced through whatever load is connected. For a gain that depends on the input, use a Function Voltage or Current Source, or a Table Source.

Definition IofI
SupportSimulated directly: becomes the ngspice element F.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

IofI: an ideal linear current-controlled current source, a current VALUE x the current into Plus Input through the source from Plus Output to Minus Output, the input read through a 0 V source, as SPICE F. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

SPICE E Source evofv

The SPICE E source, with two pins for its output. Its Value is written as SPICE writes the rest of the line after the output nodes: <node+> <node-> <gain>: the two nodes whose voltage controls it, named as on the schematic (0 is ground), and the gain. The POLY form is refused.

Example

A Value of IN 0 10 makes the output 10 times the voltage of node IN, as a voltage.

Definition EVofV
SupportSimulated directly: becomes the ngspice element E.
PinsPlus, Minus
Technical notes

EVofV, the SPICE E source: VALUE is SPICE's tail after the two output nodes, <node+> <node-> <gain>, the nodes by name (0 is ground). POLY forms are refused. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

SPICE F Source fiofi

The SPICE F source, with two pins for its output. Its Value is written as SPICE writes the rest of the line after the output nodes: <source> <gain>: the part name of the voltage source whose current controls it, and the gain. The POLY form is refused.

Example

A Value of V1 10 makes the output 10 times the current through V1, as a current.

Definition FIofI
SupportSimulated directly: becomes the ngspice element F.
PinsPlus, Minus
Technical notes

FIofI, the SPICE F source: VALUE is SPICE's tail after the two output nodes, <source> <gain>, the source a voltage source's part name. POLY forms are refused. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

SPICE G Source giofv

The SPICE G source, with two pins for its output. Its Value is written as SPICE writes the rest of the line after the output nodes: <node+> <node-> <gain>: the two nodes whose voltage controls it, named as on the schematic (0 is ground), and the gain. The POLY form is refused.

Example

A Value of IN 0 10 makes the output 10 times the voltage of node IN, as a current.

Definition GIofV
SupportSimulated directly: becomes the ngspice element G.
PinsPlus, Minus
Technical notes

GIofV, the SPICE G source: VALUE is SPICE's tail after the two output nodes, <node+> <node-> <gain>, the nodes by name (0 is ground). POLY forms are refused. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

SPICE H Source hvofi

The SPICE H source, with two pins for its output. Its Value is written as SPICE writes the rest of the line after the output nodes: <source> <gain>: the part name of the voltage source whose current controls it, and the gain. The POLY form is refused.

Example

A Value of V1 10 makes the output 10 times the current through V1, as a voltage.

Definition HVofI
SupportSimulated directly: becomes the ngspice element H.
PinsPlus, Minus
Technical notes

HVofI, the SPICE H source: VALUE is SPICE's tail after the two output nodes, <source> <gain>, the source a voltage source's part name. POLY forms are refused. Verified against reference results on the authored DEP_SRC.cir (run 20261108T055122Z-f4a801, all seven dependent sources from one 2 V input, each into 1k): its output exact at the CSV's print precision.

Tie tie

A named connection point. Every Tie with the same name is on the same net, whether or not a wire joins them, which keeps a crowded schematic readable: a supply rail, for instance, can be a Tie at each part that needs it. The name joins the pins but is not a node name for plots: label the net with the Text tool to plot it by name.

Definition Tie
SupportSimulated directly.
PinsPinA
Technical notes

Tie: a named connection point. Every Tie with the same PART is on one net, wired or not; the name is not a node name for plots. Ties are joined before node numbering, so plots by node number map through them. Writes no element. Verified against reference results on MOSDIFF.cir (eight Ties in two groups, NMOS level 1): every column within 0.42% of peak-to-peak, set by the CSV's printed digits.

Animated Meter meter

The animated meter: a voltmeter or ammeter between its Plus and Minus pins, chosen by Amps or Volts. As a voltmeter it is a resistor of its INPUT_RESISTANCE (very large when unset); as an ammeter, a 0.001 ohm resistor in series. Its display settings (scale, range, analog or digital) are kept in the file but do not change the circuit. Read its value by plotting the voltage across it, or the current through it.

Definition ANIMATED METER
SupportSimulated directly: becomes the ngspice element R.
PinsPlus, Minus
Technical notes

ANIMATED METER: a two-pin voltmeter or ammeter that loads the circuit. Only AMPS OR VOLTS changes it, read without case: Volts is a resistor of INPUT_RESISTANCE (1/GMIN when absent or empty) from Plus to Minus, Amps a 0.001 ohm resistor in series. The display attributes (ANALOG OR DIGITAL, AUTOSCALE, LOW, HIGH, SCALE) are kept and not simulated. Verified against reference results on two community files (S3 corpus/community, not in git): a voltmeter circuit, run 20261107T202049Z-038462 (Transient; v(1) and v(2) within 1.1e-10 V of Micro-Cap's, over 55 rows), and an ammeter circuit, run 20261107T202254Z-808c68 (operating point; all six node voltages equal to Micro-Cap's three printed decimals, 0.5 mV at most, and its expansion is a METER1.R of 0.001 ohm at 0.99998 A, as here). In AC it is the same resistor (GnomYeaH sem5 circuit1, run 20261108T232057Z-cc69ec: dB(v(L1)) and ph(v(L1)) within 0.005 dB and 0.005 deg at all 1001 points; Syricoff's three Lab1_Evs files). A meter inside a subcircuit body, or in a DC sweep, is still refused: those were not run.

Constant Current Source isource

The Constant Current Source: a DC current between Plus and Minus, its Value a number such as 1m. The current flows through the source from Plus to Minus, as for the Current Source. It has no AC value, so it contributes nothing to an AC analysis, and a DC sweep of it is refused, since how Micro-Cap sweeps it is not measured.

For a current with a waveform or an AC value, use a Current Source instead.

Definition Isource
SupportSimulated directly: becomes the ngspice element I.
PinsPlus, Minus
Technical notes

Isource: a constant current source, VALUE a number with an optional LOT tolerance (dropped, Monte Carlo only), netlisted as DC <value> with no AC magnitude. Current flows from Plus through the source to Minus, as ISpice's (supported by the shape's arrow and by Voltage Limiter.cir). Verified at the operating point against reference results on two community files (S3 corpus/community, not in git): one ISource of 1 mA, run 20261107T204759Z-99f79d, and four, run 20261107T205326Z-5f8efc; every node voltage equal to Micro-Cap's printed three decimals (the largest node 5 V) and the source's own voltage and pin current equal. In AC it has no AC part (MIPT Lab_24 hpar.CIR, run 20261108T231757Z-458acf, prints 0 for v(I1) at every frequency; xpar.CIR, run 20261108T231926Z-b89c6e, -1000 dB). A DC sweep with one is not measured and is refused. The transient case follows from the operating point (a constant source); no transient run of one was made.

Jumper jumper

A two-pin part that joins its pins into one net, so a connection can pass over a wire without joining it. It adds nothing to the simulation: its two pins are simply the same node.

Definition Jumper
SupportSimulated directly.
PinsPinA, PinB
Technical notes

Jumper: a two-pin part that joins its pins into one net, so a conductor can pass over a wire. Takes no PART; the two nets are merged before node numbering and no element is written. Verified against reference results on AUTH_PARTS34 (run 20261105T230339Z-38b1b1): a Jumper in place of a wire leaves v(1) to v(3) unchanged within 4 digits on 4 nodes, an exact short, and node numbers don't shift; a wire crossing between its pins stays apart (run 20261105T230540Z-017de3).

User Source usersource

A voltage source that plays one curve from a Micro-Cap .USR data file: the curve named by its EXPRESSION, or the file's only curve. The points are joined by straight lines, REPEAT plays the curve that many times, and after the last play the output holds its last value. The data file must be next to the circuit file, or held on a text page of the circuit; without it the part says which file it needs.

Definition User source
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus
Technical notes

User source: a voltage source from Plus to Minus playing one curve of a.USR data file, the curve whose Label is EXPRESSION (read without case; an empty EXPRESSION takes a file's only curve). Its (T, Y) rows are a piecewise linear wave, linearly interpolated, and REPEAT plays it that many times with the period its last T; after the last play it holds its last value (probe user-repeat, run 20261110T045656Z-06da06). The file is a companion beside the.CIR, or a text page of the file named as FILE (with or without.USR); without one the part refuses, naming the file. ENABLE_EXPR must be a constant above 0 (always on), since a source that freezes when it turns false has no ngspice form. Verified against reference results with the CD's companion files: USER2.cir (run 20261109T003632Z-678ab8), its two sources equal to USER2.USR's v(out1) and v(out2) curves within the print's 4 digits, and USER.cir (run 20261109T003632Z-6bcf05), REPEAT=5 playing SAMPLE.USR five times.

WAV File Source wavsource

A voltage source that plays one channel of a .WAV sound file (CHANNEL 0 the left, 1 the right): an 8 or 16-bit uncompressed sample becomes a voltage of up to ±1 V, times SCALE, joined by straight lines. REPEAT plays it that many times, and after the end the output holds its last sample. The file must be next to the circuit file. Compressed files and files with more than two channels are refused.

Definition WAV File Source
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus
Technical notes

WAV File Source: a voltage source from Plus to Minus playing one channel (CHANNEL 0 the left, 1 the right) of an uncompressed PCM.WAV file, linearly interpolated between samples: an 8-bit sample u is (u - 128)/127 V and a 16-bit one u/32768 V, times SCALE, and after the file ends the output holds its last sample. REPEAT plays it that many times, each play from the last one's last sample time (N - 1)/rate (probe user-repeat), and only the samples the run's transient reaches are written. The file is a companion beside the.CIR; without one the part refuses, naming the file. ENABLE_EXPR must be a constant above 0, and a compressed file or one with more than 2 channels is refused. Verified against reference results with the CD's companion files: WAV.cir with gin.wav (8 bit mono, run 20261109T003632Z-c28083) and WAVSource.cir with ode_to_joy.wav (16 bit stereo, run 20261109T003632Z-5c2e44).

Fixed Analog analogstate

A fixed voltage from its one pin to ground: its Value in volts, such as 5 or 20v. It is an ideal source, with no series resistance.

Definition ANALOG STATE
SupportSimulated directly: becomes the ngspice element V.
PinsOut
Technical notes

Fixed Analog, Definition ANALOG STATE: an ideal DC voltage source of VALUE volts from its one pin to ground, netlisted as V<part> <pin> 0 DC <VALUE>. VALUE is a number with an optional unit letter, which is ignored (20v is 20 V). Verified against reference results: 4EFI MIPT Lab_24 dac.CIR (run 20261108T231756Z-3ebf68), its four parts listed as SPICE sources at their VALUEs, and Forward Using UC1846.CIR with the operating point on (run 20261109T211257Z-27f417), V36 at 20.000 V delivering 20.566 mA with its node at exactly 20.000 V, so ground is its reference and it has no series resistance. Inside a subcircuit body it is refused.

Loop Gain Probe loopgainprobe

Marks where Micro-Cap's stability analysis breaks a feedback loop. In every analysis CirSpice runs it is a plain connection between its Plus and Minus pins (a 0 V source, so its current can be plotted). The stability analysis itself is not available in CirSpice yet.

Definition Loop Gain Probe
SupportSimulated directly: becomes the ngspice element V.
PinsPlus, Minus
Technical notes

Loop Gain Probe: the point where a Stability analysis breaks the loop. Outside that analysis it is transparent, a 0 V source from Plus to Minus (a short that measures current), in transient, DC and AC alike; its PART and display attributes are kept and not simulated. Verified against reference results on Stability1.cir (S3 corpus/examples, not in git), run 20261108T215427Z-913819, operating point: Micro-Cap's expansion is PROBE1.Vinj and PROBE1.Vol, both 0 V and carrying the loop's 32.26 nA in series from Plus to Minus, and PROBE1.Iinj at 0 A, which is this element. The Stability analysis itself (two AC runs and Tian's formula) is not built.

Animated SPDT Switch animspdt

A single-pole double-throw switch set by its State: UP joins the common pin C to A, DOWN joins it to B. The closed side is RON and the open side ROFF, by default 0.001 ohm and 1e15 ohm. The state stays as set for the whole run; change it in the attribute dialog between runs.

Definition ANIMATED SPDT SWITCH
SupportSimulated directly: becomes the ngspice element R.
PinsA, B, C
Technical notes

ANIMATED SPDT SWITCH: two resistors from the common pin C, set by STATE, read without case. UP joins C to A through RON and C to B through ROFF; DOWN the reverse. RON and ROFF default to.001 and 1E15. GROUP only ties switches together in the editor and is not simulated. Verified against reference results on the authored ANIM_SPDT runs (SPDT_UP and SPDT_DOWN, 20261109T194159Z): 1 V on A and B grounded give v(OUT) 1 V in UP and 1E-18 V in DOWN, through 1k to ground. The state cannot change during a run. Inside a subcircuit body it is refused.

Animated SPST Switch animspst

A single-pole switch between A and B set by its State: CLOSED is RON, OPEN is ROFF, by default 0.001 ohm and 1e15 ohm. The state stays as set for the whole run.

Example

1 V on A, B to a node OUT with 1k to ground, RON 100 and ROFF 1k: v(OUT) is 1k/1.1k, about 0.909 V, closed, and 0.5 V open.

Definition ANIMATED SPST SWITCH
SupportSimulated directly: becomes the ngspice element R.
PinsA, B
Technical notes

ANIMATED SPST SWITCH: one resistor from A to B, set by STATE, read without case: RON when CLOSED, ROFF when OPEN. RON and ROFF default to.001 and 1E15. GROUP only ties switches together in the editor and is not simulated. Verified against reference results on the authored ANIM_SPST runs (SPST_CLOSED and SPST_OPEN, 20261110T154806Z): 1 V on A and B to OUT with 1k to ground, RON 100 and ROFF 1k, give v(OUT) 0.9091 V closed and 0.5000 V open. The state cannot change during a run. Inside a subcircuit body it is refused.

Animated Analog LED animled

A light-emitting diode from Anode to Cathode, its model fitted to its COLOR: name,von,ion[,rs[,cjo]], the forward voltage at a given current, with optional series resistance and capacitance; a bare Red, Yellow, Green or Blue takes the library's values. The fit holds at 27 C, so a run at another temperature is refused.

Example

COLOR Red,1.7,15m is a diode that passes 15 mA at 1.7 V.

Definition ANIMATED ANALOG LED
SupportSimulated directly: becomes the ngspice element D.
PinsAnode, Cathode
Technical notes

ANIMATED ANALOG LED: a diode from Anode to Cathode fitted to COLOR, written name,von,ion[,rs[,cjo]] (units such as V, A, ohm and F are read as suffixes; a bare Red, Yellow, Green or Blue takes the library's values). Its model is N=1, RS=rs (default.5), CJO=cjo (default 20p) and IS = ion/exp((von - ion RS)/VT), VT at 27 C, so it passes ion at von. The fit is measured at 27 C only, and ngspice would scale a fitted IS from TNOM, so a run at another temperature, or a TNOM other than 27 C, is refused. COLOR_REF and VON are display settings and are not simulated. Verified against reference results on the authored ANIM_LED run (LED_RED, COLOR=Red,1.7,0.015, 20261109T194159Z): every point from 10 uA to 8.2 mA gives Micro-Cap's IS of 5.719E-31 within 0.2 %; CJO is not measured. Inside a subcircuit body it is refused.

Animated Analog Bar animbar

A bar display of the voltage between its Plus and Minus pins, from LOW to HIGH. It draws no current, so it does not change the circuit.

Definition ANIMATED ANALOG BAR
SupportSimulated directly.
PinsPlus, Minus
Technical notes

ANIMATED ANALOG BAR: a display of V(Plus, Minus) from LOW to HIGH that loads nothing, so it writes no element. Verified against reference results on the authored ANIM_LOAD run (BAR_LOAD, 20261109T194159Z): 1 V through 1 Meg into Plus prints 1 exactly to 7 digits, so no load or one above about 1E13 ohm.

Animated Traffic Light animlight

A traffic light with three lamps, Red, Yellow and Green, each lit when its pin's voltage to ground passes its turn-on voltage. It draws no current, so it does not change the circuit.

Definition ANIMATED TRAFFIC LIGHT
SupportSimulated directly.
PinsRed, Yellow, Green
Technical notes

ANIMATED TRAFFIC LIGHT: three lamps that light when their pin's voltage to ground exceeds TURN-ON VOLTAGES; it loads nothing, so it writes no element. Verified against reference results on the authored ANIM_LOAD run (LIGHT_LOAD, 20261109T194159Z): 1 V through 1 Meg into Red prints 1 exactly to 7 digits, so no load or one above about 1E13 ohm.

Table Source ntvofv

A table source: its output voltage is a function of its input voltage, given as a table of (input, output) pairs in its Table attribute. Between the pairs the output is interpolated linearly, and outside them it holds the first or last value. The input values must ascend.

The input is the voltage between Plus Input and Minus Input. The output is the voltage between Plus Output and Minus Output.

Example

(-1,0) (0,0) (1,1) (2,1.5) (5,2)

This table gives 0 for every input below 0, rises with a slope of 1 up to an input of 1, then flattens, and holds 2 for every input above 5. Smoothing other than none, and interpolation other than linear, are refused.

Definition NTVofV
SupportSimulated directly: becomes the ngspice element B.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

NTVofV table source: output voltage, a table of the input voltage, linear between the pairs and held at the end values, as an ngspice B source with pwl() of the clamped input. An input current is the current into Plus Input, read through a 0 V source from Plus to Minus Input; an output current flows through the source from Plus to Minus Output (both hypotheses in 4.29). SMOOTHING other than No is refused, except Inherit from Preferences, read as No (the shipped Preferences value); so is INTERPOLATION other than Linear_X_Linear_Y. Verified against reference results on T1.cir, all four types on one table: RMS 0.056% of peak to peak each.

Table Source ntvofi

A table source: its output voltage is a function of its input current, given as a table of (input, output) pairs in its Table attribute. Between the pairs the output is interpolated linearly, and outside them it holds the first or last value. The input values must ascend.

The input current is the current flowing into Plus Input and out of Minus Input. The output is the voltage between Plus Output and Minus Output.

Example

(-1,0) (0,0) (1,1) (2,1.5) (5,2)

This table gives 0 for every input below 0, rises with a slope of 1 up to an input of 1, then flattens, and holds 2 for every input above 5. Smoothing other than none, and interpolation other than linear, are refused.

Definition NTVofI
SupportSimulated directly: becomes the ngspice element B.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

NTVofI table source: output voltage, a table of the input current, linear between the pairs and held at the end values, as an ngspice B source with pwl() of the clamped input. An input current is the current into Plus Input, read through a 0 V source from Plus to Minus Input; an output current flows through the source from Plus to Minus Output (both hypotheses in 4.29). SMOOTHING other than No is refused, except Inherit from Preferences, read as No (the shipped Preferences value); so is INTERPOLATION other than Linear_X_Linear_Y. Verified against reference results on T1.cir, all four types on one table: RMS 0.056% of peak to peak each.

Table Source ntiofi

A table source: its output current is a function of its input current, given as a table of (input, output) pairs in its Table attribute. Between the pairs the output is interpolated linearly, and outside them it holds the first or last value. The input values must ascend.

The input current is the current flowing into Plus Input and out of Minus Input. The output current flows through the source from Plus Output to Minus Output.

Example

(-1,0) (0,0) (1,1) (2,1.5) (5,2)

This table gives 0 for every input below 0, rises with a slope of 1 up to an input of 1, then flattens, and holds 2 for every input above 5. Smoothing other than none, and interpolation other than linear, are refused.

Definition NTIofI
SupportSimulated directly: becomes the ngspice element B.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

NTIofI table source: output current, a table of the input current, linear between the pairs and held at the end values, as an ngspice B source with pwl() of the clamped input. An input current is the current into Plus Input, read through a 0 V source from Plus to Minus Input; an output current flows through the source from Plus to Minus Output (both hypotheses in 4.29). SMOOTHING other than No is refused, except Inherit from Preferences, read as No (the shipped Preferences value); so is INTERPOLATION other than Linear_X_Linear_Y. Verified against reference results on T1.cir, all four types on one table: RMS 0.056% of peak to peak each.

Table Source ntiofv

A table source: its output current is a function of its input voltage, given as a table of (input, output) pairs in its Table attribute. Between the pairs the output is interpolated linearly, and outside them it holds the first or last value. The input values must ascend.

The input is the voltage between Plus Input and Minus Input. The output current flows through the source from Plus Output to Minus Output.

Example

(-1,0) (0,0) (1,1) (2,1.5) (5,2)

This table gives 0 for every input below 0, rises with a slope of 1 up to an input of 1, then flattens, and holds 2 for every input above 5. Smoothing other than none, and interpolation other than linear, are refused.

Definition NTIofV
SupportSimulated directly: becomes the ngspice element B.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

NTIofV table source: output current, a table of the input voltage, linear between the pairs and held at the end values, as an ngspice B source with pwl() of the clamped input. An input current is the current into Plus Input, read through a 0 V source from Plus to Minus Input; an output current flows through the source from Plus to Minus Output (both hypotheses in 4.29). SMOOTHING other than No is refused, except Inherit from Preferences, read as No (the shipped Preferences value); so is INTERPOLATION other than Linear_X_Linear_Y. Verified against reference results on T1.cir, all four types on one table: RMS 0.056% of peak to peak each.

Ground ground

The reference node, 0 V. Every circuit needs at least one ground, and every node needs a path to it through the circuit: a node joined to the rest only through capacitors, for example, has no defined DC voltage, and the simulator reports a singular matrix (see When a run fails).

Definition Ground
SupportSimulated directly.
PinsPinA
Technical notes

Ground (node 0)

Subcircuit subcircuit

A part that calls a .SUBCKT definition by its name: each of the part's pins connects to the definition's port in the same position. The definition can be on the circuit's text page (see .SUBCKT) or in a library CirSpice can read (see Models and libraries). Parameters the definition declares can be set per part. The technical notes say which kinds of definition body are read today.

Definition Subckt
SupportSimulated directly: becomes the ngspice element X.
Technical notes

Subcircuit call: a Micro-Cap Subckt whose.SUBCKT body is in the file's text area, read into typed parts, or a core library subcircuit. Bodies of R, C and L only so far; a body in Micro-Cap's library or a FILE is refused. Verified against reference results on FerriteBead_S_Plot.cir.

Supported through a model (51)

Sine Source sine

The Sine Source, between its Plus and Minus pins. It takes its settings from a SIN model rather than from its value: the frequency F, the amplitude A, the DC offset DC, the phase PH in radians, and a series resistance RS. Unset, F is 1 MHz, A is 1 V, DC and PH are 0 and RS is 1 milliohm. CirSpice writes it as a SPICE sine source behind that resistance.

The model's exponential envelope (TAU and RP) is not supported yet. In an AC analysis the source is 1 V at phase 0.

Example

.MODEL 1KHZ SIN (F=1k A=2 DC=1)

A Sine Source with this model gives a 1 kHz sine of 2 V peak around 1 V: from −1 to 3 V. A phase of a quarter cycle is PH=1.5708, in radians.

Definition Sine source
SupportSimulated through a CirSpice model built from ngspice parts (MC_SINE_SOURCE), checked on 2 circuit files against reference results, RMS difference 0.16%.
PinsPlus, Minus
Model.MODEL name SIN.
Technical notes

Sine source: a SIN model (F, A, DC, PH in radians, RS) as a SPICE SIN source behind its series resistance. The exponential envelope (TAU, RP) is refused. FFT7.cir verifies F and A (0.02%); AUTH_SOURCES.cir verifies PH, DC and polarity (0.16%, the worst, set by the CSV's 4 printed digits on the slopes). An explicit RS=0 is kept as 0 and netlisted through MC_SINE_SOURCE_IDEAL, the SIN source alone; that it simulates as ideal is supported, not measured. In AC it is a 1 V source, phase 0; no AC reference run has a Sine source yet.

Opamp opamp

The opamp, with pins Plus input, Minus input, Output, VCC and VEE. Its behaviour comes from an OPA model, and its LEVEL picks how much of a real opamp it shows. ngspice has no opamp element, so CirSpice builds one for each level:

  • Level 1: the open-loop gain A times the difference between the inputs, behind the output resistance. The supply pins do not limit the output.
  • Level 2: three gain stages that add the gain-bandwidth (GBW) and phase-margin (PM) poles and limit the slew rate (SRP and SRN).
  • Level 3: a full macromodel with NPN, PNP or JFET inputs (TYPE 1, 2 or 3), adding the input offset voltage and currents (VOFF, IOFF, IBIAS), common-mode rejection (CMRR) and an output that clips short of the supplies.

Use level 1 for the ideal behaviour of a feedback circuit, and level 3 when slew, offsets or clipping matter.

Worked example: an inverting amplifier

  1. On the text page: .MODEL OA OPA (LEVEL=3 TYPE=1 A=2e5 GBW=1MEG SRP=5e5 SRN=5e5 VCC=15 VEE=-15).
  2. Place the opamp with Model OA. Ground its plus input. Connect a resistor of 10k from the source to the minus input, and one of 100k from the minus input to the output, labelled OUT. Supply VCC with a 15 V Battery and VEE with a −15 V one.
  3. Drive the input from a Voltage Source SIN(0 0.1 1k), pick Transient with a run time of 3m, plot v(OUT), and run.

The output is the input inverted and ten times larger: a 1 V peak sine. It sits about 21 mV above 0 V, because the model is not ideal: its default input offset of 1 mV is multiplied by the circuit's noise gain of 11, and its default 100 nA input bias current flows through the 100k feedback resistor. Raise the input amplitude to 2 and the output would need 20 V: at level 3 it clips short of the 15 V supplies, at about 13.5 V, while at level 1 it would not clip at all.

Definition Opamp
SupportSimulated through a CirSpice model built from ngspice parts (MC_OPAMP_L1), checked on 7 circuit files against reference results, RMS difference 0.04%.
PinsPlus input, Minus input, Output, VCC, VEE
Model.MODEL name OPA.
Technical notes

Opamp, level 1: a high-gain voltage-controlled source A x (V(+in) - V(-in)) behind the output resistance ROUTAC + ROUTDC, in every analysis. VCC and VEE do not bound the output (level 1). Level 3 goes to MC_OPAMP_L3_NPN / _PNP / _JFET, the enhanced Boyle macromodel (TYPE 1, 2 and 3); the JFET input is a P-channel pair with VTO -2, VOFF as a VTO difference and each gate's IS (IBIAS +- IOFF/2) / 2, fitted to the TYPE=3 reference measurements (AUTH_OPAMP variants: t = 0 offsets for VOFF, IBIAS and IOFF within print resolution, fine-step slew within 0.0024% and the CMRR 1E5 and 1K followers within 0.003% of peak-to-peak), at 27 C only, and SRP > SRN refused as Micro-Cap refuses it; known difference: edge timing at Micro-Cap's default step, up to 0.11 V on the probes, as the NPN level 3 shows on the same circuits; AUTH_OPAMP_L3B.cir verifies the NPN input to 0.035% of peak-to-peak, clamp included (-8.5455 V against -8.545 V); AUTH_OPAMP_L3B_PNP.cir the PNP input (0.037%) and AUTH_OPAMP_L3B_T50.cir 50 C (0.038%, VT at the run temperature). Level 2 goes to MC_OPAMP_L2, three GM stages with the GBW/A and PM poles and stage 1's current clamped for SRP and SRN; AUTH_OPAMP_L2_ASYM.cir verifies it to 0.0048% of peak-to-peak, both slew edges included, and AUTH_OPAMP_L2_1U.cir to 0.0094%. AUTH_OPAMP.cir verifies the pin mapping and input polarity (its feedback hides A and R); AUTH_OPAMP_ROUT.cir (A=10, so R sets the output) verifies R = ROUTAC + ROUTDC (0.030% of peak-to-peak; ROUTDC alone would miss the settled output by 0.29 V).

Transformer transformer

The two-winding transformer, with pins Plus Input and Minus Input (primary) and Plus Output and Minus Output (secondary). Its Value is three numbers separated by commas: the primary inductance, the secondary inductance and the coupling coefficient. CirSpice writes it as two coupled inductors, Plus pins dotted.

Example

A Value of 1m,4m,0.999 is the same 1:2 transformer as the Coupling part's example: the turns ratio is √(4m / 1m) = 2. A value that is not three numbers is refused with a message.

Definition Transformer
SupportSimulated through a CirSpice model built from ngspice parts (MC_TRANSFORMER), checked on 1 circuit file against reference results, RMS difference 0.04%.
PinsPlus Input, Minus Input, Plus Output, Minus Output

Fields in its attribute dialog

AttributeLabelUnitWhat it is
VALUEValuePrimary inductance, secondary inductance and coupling
LPPrimary inductanceHInductance of the primary winding
LSSecondary inductanceHInductance of the secondary winding
KCouplingCoupling coefficient, 0 to 1; no unit
Technical notes

Transformer, VALUE primary, secondary, k: two inductors and a linear K, Plus pins dotted, with Micro-Cap's 1/GMIN resistor (1E12) between Plus Input and Plus Output.

Voltage Switch vswitch

A voltage-controlled switch (Micro-Cap's S part), with pins Plus Output and Minus Output for the switch, and Plus Control and Minus Control for the voltage that drives it. Its behaviour comes from a VSWITCH model, in one of two modes:

  • Smooth, with VON and VOFF: the resistance moves smoothly from ROFF to RON as the control voltage goes from VOFF to VON. Unset, VON is 1 V, VOFF 0 V, RON 1 ohm and ROFF 1 MEG.
  • Hysteresis, with VT and VH: the switch turns on above VT + VH and off below VT − VH, starting off.

Example

.MODEL SW1 VSWITCH (VON=3 VOFF=1 RON=0.1 ROFF=10MEG)

Drive the control pins with a slow ramp: below 1 V the switch is 10 MEG, above 3 V it is 0.1 ohm, and in between it moves smoothly, so the run does not stall on a sudden step.

Definition S
SupportSimulated through a CirSpice model built from ngspice parts (MC_VSWITCH), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsPlus Output, Minus Output, Plus Control, Minus Control
Model.MODEL name VSWITCH.
Technical notes

Voltage-controlled switch (Micro-Cap S), smooth mode: VON and VOFF given, resistance on Micro-Cap's log-cubic curve from ROFF to RON. Hysteresis mode (VT, VH) is ngspice's S switch, starting off, with both edges included. AUTH_S.cir verifies VON > VOFF only; the mirrored curve for VON < VOFF is untested.

Switch switch

The Switch: a resistor between Plus Output and Minus Output that is either on (RON) or off (ROFF), set by a window. Its Value is a mode letter followed by numbers, separated by commas:

  • V,n1,n2[,ron[,roff]]: on while the voltage across the input pins is between n1 and n2.
  • I,n1,n2[,ron[,roff]]: on while the current through an inductor across the input pins is between n1 and n2 (transient only).
  • T,n1[,n2[,ron[,roff]]]: on while time is between n1 and n2, or from n1 to the end with no n2; the input pins are not used (transient only).

With n1 greater than n2 the window is inverted. Unset, RON is 1 milliohm and ROFF is 1e15 ohms. The switch changes state at once, at the first time point past the threshold.

Example

A Value of T,1m,2m,0.01 closes the switch with 10 milliohms at 1 ms and opens it at 2 ms: a simple way to connect a load for part of a run.

Definition Switch
SupportSimulated through a CirSpice model built from ngspice parts (MC_SWITCH_V), checked on 4 circuit files against reference results, RMS difference 0.00%.
PinsPlus Output, Minus Output, Plus Input, Minus Input

Fields in its attribute dialog

AttributeLabelUnitWhat it is
N1Lower limitVThe control voltage at one end of the switching range
N2Upper limitVThe control voltage at the other end of the switching range
RONOn resistanceΩResistance when the switch is on
ROFFOff resistanceΩResistance when the switch is off
Technical notes

Switch, V mode: on (ron) while the input voltage is between n1 and n2, off (roff) otherwise, inverted when n1 > n2. Changes state abruptly, at the first time point past the threshold. T mode: the same window rule with time as the control, at each of the run's steps with no breakpoint at n1 or n2, the input pins unused; T,n1 with no n2 is on from n1 to the end; in a transient only (an AC or DC run is refused, unmeasured). I mode: the same window rule on the current through the inductor across the input pins, read through a 0 V source at its first pin, in a transient only; refused with no such inductor. SWITCH.cir (S3, I,5MA,6MA) verifies it within the agreement check's default tolerance. AUTH_SWITCH.cir verifies the lower bound of an n1 < n2 window only; the upper bound and the n1 > n2 inversion are untested. Lm117reg.cir (T,1M,2M) and community circuit30L.cir (T,0) verify the T mode within the agreement check's default tolerance; an edge can land one maximum step from Micro-Cap's.

Laplace Source lfvofv

A voltage source whose output, between Plus Output and Minus Output, is its input voltage (between Plus Input and Minus Input) passed through a transfer function H(S). Write the function in the Laplace attribute as a ratio of polynomials in S, using numbers, S, PI, + - * /, parentheses and whole powers with ^; a delay factor exp(-S*T) with a positive constant T is also accepted. Orders up to 8 are supported.

CirSpice solves the transfer function exactly in every analysis. Micro-Cap computes its transient through an approximation, so small differences in time are expected and come from Micro-Cap's side.

Worked example: a second-order low-pass

For a 1 kHz corner with a quality factor of 0.707, the angular frequency is w0 = 2π · 1k, about 6283. Enter 39.48e6/(S^2 + 8886*S + 39.48e6): the numerator and the constant term are w02, and the S term is w0/Q. An AC run from 10 Hz to 100 kHz shows a flat response that is 3 dB down at 1 kHz and falls at 40 dB per decade beyond.

Definition LFVofV
SupportSimulated through a CirSpice model built from ngspice parts (MC_LAPLACE), checked on 3 circuit files against reference results, RMS difference 0.07%.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

Laplace voltage source (LFVofV): a rational H(S) of order up to 8 (the 4-state shim up to order 4, MC_LAPLACE_HI above it), read from LAPLACE after.DEFINE substitution, realised exactly as a state-space system. Micro-Cap's transient convolves with an impulse response from an inverse FFT instead, an approximation. Verified against reference results on L1.cir (a second-order lowpass beside its discrete R L C twin): 0.068% of peak-to-peak, Micro-Cap's own convolution error, at Micro-Cap's own step there, TMAX/4096, set by the part's NUMBER_OF_DATAPOINTS (hypothesis). Order 5 to 8 (MC_LAPLACE_HI) and a Laplace source inside a macro body are exact against the closed form in ngspice, and verified against reference results at order 8 with a delay in a macro body (community_lap_order8.cir, 0.019% of span; the body fixes the step at stop/4096). Orders 5 to 7 and the plain MC_LAPLACE_HI use the same states. A Z-transform source inside a macro body is refused: its one reference run differs by 6% and the cause is not settled. A delay factor exp(-S*T), T a positive constant, is exact: an ideal transmission line ended in its Z0 after the rational part (MC_LAPLACE_DELAY), verified on AUTH_LAP_EXP.cir against reference results (V(O1) within 0.0047% of its span.24 allows 0.1% transient, 0.1% and 0.05 degrees AC). A numerator one order above the denominator (an S term, as in a PD term a + b*S) is divided out: the proper rest through the state space and ks*S as the input's derivative, a buffered copy across 1 F read through a 0 V source into a CCVS (MC_LAPLACE_S, MC_LAPLACE_HI_S), exact in AC and transient; verified on Poles and Zeros.cir's AC run (1 + S*10u, dB(V(Zero)) within 0.00015 dB). In a transient Micro-Cap convolves such a term too, so an exact derivative of a fast edge differs from its (TYPE_5_AMP.CIR's 0.000238*S on a 10 ns edge: 119000 V for 10 ns here, ringing to -4493 V there; ours kept). Still refused: exp of anything else (non-rational), a delay in a sum of terms, a delay inverted, T not positive, non-rational H(S) (SQRT, POW), an S term with a delay, and a numerator two or more orders above the denominator.

Z Transform Source zlfvofv

Definition ZLFVofV
SupportSimulated through a CirSpice model built from ngspice parts (MC_ZTRANSFORM), checked on 2 circuit files against reference results, RMS difference 0.24%.
PinsPlus Output, Minus Output, Plus Input, Minus Input
Technical notes

Z-transform source (ZLFVofV): a causal rational H(Z) of order up to 4 from ZEXP after.DEFINE, with Z = exp(S / CLOCK FREQUENCY), realised exactly: each z^-1 is an ideal line delay of 1/clock on the input or the output, the history before t = 0 zero. Micro-Cap's transient is an FFT convolution instead, ringing within each clock interval. Verified against reference results on TYPE_7_AMP.CIR (a first-order H(Z) at 40 kHz): 0.016% of peak-to-peak on the per-interval means; zdomain.cir (order 3, 24 kHz) 0.24% point by point. Non-rational and non-causal H(Z) are refused.

Sample and Hold samplehold

A sample and hold: a voltage source between Plus and Minus whose output takes the value of its INPUT EXPR, a node voltage such as V(IN), once every PERIOD from time 0, and holds it until the next sample. It works in transient runs only. A sampling condition (SAMPLE EXPR) is not supported yet.

Example

With INPUT EXPR V(IN), a 1 kHz sine on IN and a PERIOD of 100u, the output is a staircase of ten steps per cycle following the sine.

Definition SAMPLE_AND_HOLD
SupportSimulated through a CirSpice model built from ngspice parts (MC_SAMPLE_HOLD), checked on 1 circuit file against reference results, RMS difference 0.20%.
PinsPlus, Minus
Technical notes

SAMPLE_AND_HOLD: a voltage source from Plus to Minus whose output is INPUT EXPR sampled once every PERIOD seconds from 0 and held until the next sample. At a PERIOD of 1 ms or more it follows Micro-Cap's measured window: one ideal switch into a capacitor closes from kP - 1 us to kP + 1.1 us, with breakpoints there, and from the operating point to 1.1 us at T = 0, so the output follows the input inside a window and holds its value at the window's end; SH_RISE, SH_RISE1U and SH_FALL (a step at, after and falling at kP) match within 0.32 %, and ZherebinVR's circuit1 within 0.62 %, the rest from Micro-Cap's own step after the window's end (W_BASE holds kP + 1.11 us, W_TS1U kP + 1.1 us). A shorter PERIOD is built as a master and slave pair of ideal switches and capacitors with complementary half-period clocks, so the output steps at each multiple of PERIOD to the input there; its window is not measured. INPUT EXPR must be a node voltage, V(node) or V(node,node), and PERIOD a positive number; a SAMPLE EXPR is refused, since whether it samples once on turning true or all the while it is true is not measured. PRECISION moves the window (4.43); at a PERIOD of 1 ms or more only its default, 1u, is accepted, and another value is refused. Transient only: an AC or DC analysis with one is refused. Verified against reference results on Sh2.cir (S3 corpus/examples, not in git), run 20261108T214952Z-b36593: v(B) (5 ns) within 0.064 % and v(C) (2 ns) within 0.198 % RMS of peak-to-peak, the largest single differences just at the sample instants where v(A) moves fast.

Timer timer

Counts events and times them. Each time its INPUTEXPR becomes true (1 or more), COUNT steps by INCREMENT from INITIAL, held at MIN and MAX; LAST is the time of the latest event and ELAPSED the time since it, times ELAPSED_SCALE. While RESET is 1 V or more, COUNT holds at INITIAL. Its outputs are the pins COUNT, LAST and ELAPSED, read as voltages.

Micro-Cap applies each event one time step late; CirSpice applies it at once, so edges can differ by a step.

Definition Timer
SupportSimulated through a CirSpice model built from ngspice parts (MC_TIMER), checked on 3 circuit files against reference results, RMS difference 0.68%.
PinsELAPSED, COUNT, LAST, RESET
Technical notes

Timer: an event each time INPUTEXPR turns true, true meaning 1 or more (0.999 and negative values are false). COUNT is INITIAL plus INCREMENT per event, held at MIN and MAX once it reaches them, and held at INITIAL while RESET is 1 V or more; LAST is the time of the last event (0 before the first) and ELAPSED is (T - LAST) times ELAPSED_SCALE, RESET leaving both alone. Built as XSPICE digital parts and ideal switches (MC_TIMER): INPUTEXPR and RESET into adc_bridges at 1, a 24-bit ripple counter of toggle flip-flops reset by RESET and stopped at the limit (or after 16777215 events, the most it holds), its bits summed through dac_bridges into COUNT, and two capacitors tracking T in turn from a toggle flip-flop, each holding the time of the event that stops it, into LAST. Micro-Cap applies each event, and RESET, one accepted time step late; this applies them at once. An INPUTEXPR already true at T = 0 is an event there, with LAST 0: a start rising 1 ps after T = 0 gates the events. Verified against reference results on timer.CIR (S3 corpus/examples, run 20261108T223744Z-c1c9f8): every column (INPUTEXPR, ELAPSED, COUNT, LAST, RESET) within tolerance, the one-step lag inside the edges' print step; on pshersby's longwei Staircase macro (run 20261111T202112Z-90956f) its COUNT, v(ISenseAmp), within 0.68% RMS, all of it on the rows printed at its steps' own instants (each 0.05 step is under the edge rule's twentieth of the 1.45 V span, so those rows stay in the RMS), where Micro-Cap's table already holds the new step and ours, with the input's 17 ps rise, is picoseconds from it; and on monostable_test.cir (run 20261108T223435Z-bb5267, the Monostable macro, with DELAY()) every column.

Inverter inv

An inverter, pins In and Out: the output is 1 when the input is 0, 0 when it is 1, and X when it is X. Its timing model's TPLH delays a rising output and TPHL a falling one; a pulse shorter than the delay does not get through.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition INV
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_INV), checked on 4 circuit files against reference results, RMS difference 0.00%.
PinsIn, Out
Technical notes

Inverter with the IO_STD I/O model at IO_LEVEL 0, DIGIOLVL 2 (the default) or 1 and the DIGIFPWR supply: an XSPICE d_inverter, and where its nodes meet analog parts, IO_STD's interfaces built from the user's Digio.lib. The input side is ATOD_STD_NX's transistor load with an adc_bridge at DO74_NX's 1.4 V; the output side is DTOA_STD's N device, its two DIN74 resistances ramped by two dac_bridges over each state's switching time. The dig-io runs verify it: levels to millivolts and edges to one time step, as Micro-Cap steps at each threshold crossing and adc_bridge acts at the next analog step. Its UGATE timing model's delays are the edge's own, TPHL falling and TPLH rising, picked by MNTYMXDLY 0 (typical), 1, 2 or 3, a missing minimum 0.4 and maximum 1.6 times typical, with no switching-time compensation into analog parts and a pulse shorter than the delay cancelled (XSPICE's inertial delay); the dig-time runs verify each, and DIO_EDGE_DEF with DLY_TTL moves Micro-Cap's zero-delay edges by exactly the delay. At DIGIOLVL 1 (4.35 item 2, DIO_RAMP_L1, run 20261108T021512Z-2109b1) an input reads X between DO74's 0.8 and 2 V, Micro-Cap's R and F included, and the output drives DIN74's X state, 1.404 V, each step within one 10 ns step of Micro-Cap's. Another I/O model where it meets an analog part (on digital nodes alone it runs, as Micro-Cap looks its interface up only there, 4.35 dig-iomodels; 283.cir matches), another IO_LEVEL or supply, MNTYMXDLY 4, a UGATE edge with no typical delay, DIGMNTYMX, DIGMNTYSCALE or DIGTYMXSCALE in.OPTIONS, INLD or OUTLD, a delay above zero within the switching time on an output to analog parts, and wired outputs are refused.

BUF buf

A buffer, pins In and Out: the output copies the input after the timing model's delay.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition BUF
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_BUF), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

AND and2

A 2-input AND gate, pins In0, In1 and Out. Its output is 1 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition AND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_AND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

AND and3

A 3-input AND gate, pins In0, In1, In2 and Out. Its output is 1 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition AND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_AND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

AND and4

A 4-input AND gate, pins In0, In1, In2, In3 and Out. Its output is 1 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition AND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_AND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

AND and5

A 5-input AND gate, pins In0, In1, In2, In3, In4 and Out. Its output is 1 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition AND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_AND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

AND and9

A 9-input AND gate, pins In0, In1, In2, In3, In4, In5, In6, In7, In8 and Out. Its output is 1 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition AND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_AND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, In5, In6, In7, In8, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NAND nand2

A 2-input NAND gate, pins In0, In1 and Out. Its output is 0 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NAND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NAND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NAND nand3

A 3-input NAND gate, pins In0, In1, In2 and Out. Its output is 0 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NAND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NAND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NAND nand4

A 4-input NAND gate, pins In0, In1, In2, In3 and Out. Its output is 0 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NAND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NAND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NAND nand5

A 5-input NAND gate, pins In0, In1, In2, In3, In4 and Out. Its output is 0 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NAND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NAND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NAND nand9

A 9-input NAND gate, pins In0, In1, In2, In3, In4, In5, In6, In7, In8 and Out. Its output is 0 only when every input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NAND
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NAND), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, In5, In6, In7, In8, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

OR or2

A 2-input OR gate, pins In0, In1 and Out. Its output is 1 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition OR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_OR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

OR or3

A 3-input OR gate, pins In0, In1, In2 and Out. Its output is 1 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition OR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_OR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

OR or4

A 4-input OR gate, pins In0, In1, In2, In3 and Out. Its output is 1 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition OR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_OR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

OR or5

A 5-input OR gate, pins In0, In1, In2, In3, In4 and Out. Its output is 1 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition OR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_OR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

OR or9

A 9-input OR gate, pins In0, In1, In2, In3, In4, In5, In6, In7, In8 and Out. Its output is 1 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition OR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_OR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, In5, In6, In7, In8, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NOR nor2

A 2-input NOR gate, pins In0, In1 and Out. Its output is 0 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NOR nor3

A 3-input NOR gate, pins In0, In1, In2 and Out. Its output is 0 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NOR nor4

A 4-input NOR gate, pins In0, In1, In2, In3 and Out. Its output is 0 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NOR nor5

A 5-input NOR gate, pins In0, In1, In2, In3, In4 and Out. Its output is 0 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NOR nor9

A 9-input NOR gate, pins In0, In1, In2, In3, In4, In5, In6, In7, In8 and Out. Its output is 0 when any input is 1, with an unknown (X) input counted as both 0 and 1: the output is X only when that changes the answer.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Example

Drive the inputs from a Stim or from voltage sources through the interface, and plot the output's level: it follows the gate's truth table, each change delayed by the timing model's rise or fall delay.

Definition NOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn0, In1, In2, In3, In4, In5, In6, In7, In8, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

XOR xor

An exclusive OR, pins In1, In2 and Out: the output is 1 when the inputs differ and 0 when they are the same.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition XOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_XOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

NXOR xnor

An exclusive NOR, pins In1, In2 and Out: the output is 1 when the inputs are the same and 0 when they differ.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition NXOR
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_NXOR), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsIn1, In2, Out
Technical notes

Standard gate: an XSPICE d_buffer, d_and, d_nand, d_or, d_nor, d_xor or d_xnor on its inputs in compdef order and its last pin, Out, with the Inverter's IO_STD interfaces where its nodes meet analog parts and its timing rules. The dig-core runs (DGT_TRUTH) confirm that each gate's Out follows its Boolean function over a 4-bit count with no extra changes, and XSPICE's unknown state follows the X rule (an X input taken as both 0 and 1); CirSpice's tests run DGT_TRUTH itself, its Stim4 count included, and drive every gate from pulse sources through the interface, checking each output's level against the truth table. A level 2 interface gives only 0 and 1, so no R, F or Z reaches a gate. The 9-input gates (And9, Nand9, Or9, Nor9: In0 to In8, then Out) take the same rules. A compdef whose pins are not its inputs then Out, another input count, and wired outputs are refused.

STIM stim1

A digital stimulus generator with 1 output. Its Command lists the changes in time, written out or as the name of a .DEFINE holding it: times absolute or relative, in seconds or in clock cycles (a C suffix, counting the TIMESTEP), with labels, loops (n TIMES, -1 for ever) and counting (INCR BY with UNTIL GE). Format sets how many outputs each character of a value covers: 1 binary, 3 octal, 4 hex. A value's first character drives the highest-numbered output.

Random values, the states R, F, X and Z, REPEAT, DECR BY and other loop forms are refused for now.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition STIM
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STIM), checked on 7 circuit files against reference results, RMS difference 0.00%.
PinsOut0
Technical notes

Stimulus generator: its command, written out or a.DEFINE's, run to a fixed list of changes up to the run's end, every loop unrolled, each output a PWL source read by an adc_bridge onto its digital node, with the IO_STD interface where it meets analog parts. The dig-core and dig-time runs confirm the times (absolute, relative, C clocks), the loops (n TIMES as n repeats, -1 for ever, the first statement after a label taking effect at the GOTO), INCR BY with UNTIL GE (counting from 0 when no value is set, and running on after the loop as STIMSAMP measured), and that a value's first character drives the highest-numbered output. Each change ramps over the ten-thousandth of the maximum time step before its time, so a change at the run's end is in the run, as Micro-Cap counts it (Counter2's counter bits at 1 us); a change at the run's end itself comes a hundredth of the maximum step early. Random values, R, F, X and Z, REPEAT, DECR BY, UNTIL other than GE, a second GOTO and a.DEFINE outside the file are refused. With I/O MODEL IO_STM its outputs drive analog parts through DTOA_STM, the N device with DINSTM, and 0.1 pF. In a macro's body (DClock.mac) its times may name the macro's parameters, which take the call's values, and the call is netlisted as the body's parts on the page; the course labs calling DClock match Micro-Cap's tables.

STIM stim2

A digital stimulus generator with 2 outputs. Its Command lists the changes in time, written out or as the name of a .DEFINE holding it: times absolute or relative, in seconds or in clock cycles (a C suffix, counting the TIMESTEP), with labels, loops (n TIMES, -1 for ever) and counting (INCR BY with UNTIL GE). Format sets how many outputs each character of a value covers: 1 binary, 3 octal, 4 hex. A value's first character drives the highest-numbered output.

Random values, the states R, F, X and Z, REPEAT, DECR BY and other loop forms are refused for now.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition STIM
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STIM), checked on 7 circuit files against reference results, RMS difference 0.00%.
PinsOut1, Out0
Technical notes

Stimulus generator: its command, written out or a.DEFINE's, run to a fixed list of changes up to the run's end, every loop unrolled, each output a PWL source read by an adc_bridge onto its digital node, with the IO_STD interface where it meets analog parts. The dig-core and dig-time runs confirm the times (absolute, relative, C clocks), the loops (n TIMES as n repeats, -1 for ever, the first statement after a label taking effect at the GOTO), INCR BY with UNTIL GE (counting from 0 when no value is set, and running on after the loop as STIMSAMP measured), and that a value's first character drives the highest-numbered output. Each change ramps over the ten-thousandth of the maximum time step before its time, so a change at the run's end is in the run, as Micro-Cap counts it (Counter2's counter bits at 1 us); a change at the run's end itself comes a hundredth of the maximum step early. Random values, R, F, X and Z, REPEAT, DECR BY, UNTIL other than GE, a second GOTO and a.DEFINE outside the file are refused. With I/O MODEL IO_STM its outputs drive analog parts through DTOA_STM, the N device with DINSTM, and 0.1 pF. In a macro's body (DClock.mac) its times may name the macro's parameters, which take the call's values, and the call is netlisted as the body's parts on the page; the course labs calling DClock match Micro-Cap's tables.

STIM stim4

A digital stimulus generator with 4 outputs. Its Command lists the changes in time, written out or as the name of a .DEFINE holding it: times absolute or relative, in seconds or in clock cycles (a C suffix, counting the TIMESTEP), with labels, loops (n TIMES, -1 for ever) and counting (INCR BY with UNTIL GE). Format sets how many outputs each character of a value covers: 1 binary, 3 octal, 4 hex. A value's first character drives the highest-numbered output.

Random values, the states R, F, X and Z, REPEAT, DECR BY and other loop forms are refused for now.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition STIM
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STIM), checked on 7 circuit files against reference results, RMS difference 0.00%.
PinsOut3, Out2, Out1, Out0
Technical notes

Stimulus generator: its command, written out or a.DEFINE's, run to a fixed list of changes up to the run's end, every loop unrolled, each output a PWL source read by an adc_bridge onto its digital node, with the IO_STD interface where it meets analog parts. The dig-core and dig-time runs confirm the times (absolute, relative, C clocks), the loops (n TIMES as n repeats, -1 for ever, the first statement after a label taking effect at the GOTO), INCR BY with UNTIL GE (counting from 0 when no value is set, and running on after the loop as STIMSAMP measured), and that a value's first character drives the highest-numbered output. Each change ramps over the ten-thousandth of the maximum time step before its time, so a change at the run's end is in the run, as Micro-Cap counts it (Counter2's counter bits at 1 us); a change at the run's end itself comes a hundredth of the maximum step early. Random values, R, F, X and Z, REPEAT, DECR BY, UNTIL other than GE, a second GOTO and a.DEFINE outside the file are refused. With I/O MODEL IO_STM its outputs drive analog parts through DTOA_STM, the N device with DINSTM, and 0.1 pF. In a macro's body (DClock.mac) its times may name the macro's parameters, which take the call's values, and the call is netlisted as the body's parts on the page; the course labs calling DClock match Micro-Cap's tables.

STIM stim8

A digital stimulus generator with 8 outputs. Its Command lists the changes in time, written out or as the name of a .DEFINE holding it: times absolute or relative, in seconds or in clock cycles (a C suffix, counting the TIMESTEP), with labels, loops (n TIMES, -1 for ever) and counting (INCR BY with UNTIL GE). Format sets how many outputs each character of a value covers: 1 binary, 3 octal, 4 hex. A value's first character drives the highest-numbered output.

Random values, the states R, F, X and Z, REPEAT, DECR BY and other loop forms are refused for now.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition STIM
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STIM), checked on 7 circuit files against reference results, RMS difference 0.00%.
Technical notes

Stimulus generator: its command, written out or a.DEFINE's, run to a fixed list of changes up to the run's end, every loop unrolled, each output a PWL source read by an adc_bridge onto its digital node, with the IO_STD interface where it meets analog parts. The dig-core and dig-time runs confirm the times (absolute, relative, C clocks), the loops (n TIMES as n repeats, -1 for ever, the first statement after a label taking effect at the GOTO), INCR BY with UNTIL GE (counting from 0 when no value is set, and running on after the loop as STIMSAMP measured), and that a value's first character drives the highest-numbered output. Each change ramps over the ten-thousandth of the maximum time step before its time, so a change at the run's end is in the run, as Micro-Cap counts it (Counter2's counter bits at 1 us); a change at the run's end itself comes a hundredth of the maximum step early. Random values, R, F, X and Z, REPEAT, DECR BY, UNTIL other than GE, a second GOTO and a.DEFINE outside the file are refused. With I/O MODEL IO_STM its outputs drive analog parts through DTOA_STM, the N device with DINSTM, and 0.1 pF. In a macro's body (DClock.mac) its times may name the macro's parameters, which take the call's values, and the call is netlisted as the body's parts on the page; the course labs calling DClock match Micro-Cap's tables.

JKFF jkff

A JK flip-flop, pins PREB, CLRB, CLKB, J, K, Q and QB. It changes on the falling edge of its clock: J alone sets it, K alone clears it, both toggle it, neither holds it.

Preset (PREB) and clear (CLRB) are active low: a 0 on either forces the output, and both at once give Q and QB both 1; releasing them together leaves the state unknown. The part starts at 0 unless DIGINITSTATE in .OPTIONS says otherwise. Setup and hold violations warn but do not change the result.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition JKFF
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_JKFF), checked on 6 circuit files against reference results, RMS difference 0.00%.
PinsPREB, CLRB, CLKB, J, K, Q, QB
Technical notes

Flip-flop or latch: an XSPICE d_jkff, d_dff, d_srlatch or d_dlatch with PREB and CLRB inverted onto its active-high set and reset, JKFF's clock inverted (it changes on the falling edge), and an OR on Q and QB so that preset and clear together, or an SRFF's S and R together with the gate high, give Q and QB both 1, as Micro-Cap does; releasing them gives X. The dig-ff runs confirm the truth tables and toggle, the initial state 0 (DIGINITSTATE 0 or 1 applies), a clock going to X not being an edge, QB taking its own direction's delay, the UEFF delays picked by MNTYMXDLY, and setup and hold violations only warning. A UEFF whose preset and clear delays do not differ from its clock delays by one amount, a UGFF with delays, and an array are refused.

DFF dff

A D flip-flop, pins PREB, CLRB, CLK, D, Q and QB. On each rising clock edge Q takes the value of D; QB is its complement.

Preset (PREB) and clear (CLRB) are active low: a 0 on either forces the output, and both at once give Q and QB both 1; releasing them together leaves the state unknown. The part starts at 0 unless DIGINITSTATE in .OPTIONS says otherwise. Setup and hold violations warn but do not change the result.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition DFF
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_DFF), checked on 6 circuit files against reference results, RMS difference 0.00%.
PinsPREB, CLRB, CLK, D, Q, QB
Technical notes

Flip-flop or latch: an XSPICE d_jkff, d_dff, d_srlatch or d_dlatch with PREB and CLRB inverted onto its active-high set and reset, JKFF's clock inverted (it changes on the falling edge), and an OR on Q and QB so that preset and clear together, or an SRFF's S and R together with the gate high, give Q and QB both 1, as Micro-Cap does; releasing them gives X. The dig-ff runs confirm the truth tables and toggle, the initial state 0 (DIGINITSTATE 0 or 1 applies), a clock going to X not being an edge, QB taking its own direction's delay, the UEFF delays picked by MNTYMXDLY, and setup and hold violations only warning. A UEFF whose preset and clear delays do not differ from its clock delays by one amount, a UGFF with delays, and an array are refused.

ADC adc4

A 4-bit analog-to-digital converter, pins In, Ref, Gnd, Convert, Status, Over-range, then the data outputs from the most significant bit down.

At each rising edge of Convert it reads In; after the model's TPCS, Status goes to 1; after TPSD more, the data outputs give round(2n · (In − Gnd) / (Ref − Gnd)), with Over-range 1 (and the data all 1s) when that reaches 2n; after TPDS more, Status returns to 0. Before the first conversion the data is X.

Example

With Ref at 5 V, Gnd at 0 V and 2.5 V on In, a 4-bit converter gives 8, binary 1000, at each conversion. Some arrangements not yet checked against Micro-Cap are refused, with a message that names them: Gnd away from ground, or In going below it, among others.

Definition ADC
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_ADC), checked on 4 circuit files against reference results, RMS difference 0.00%.
Technical notes

ADC: In is read at each rising edge of Convert; after TPCS Status goes 1 and the data and Over-range go X; after TPSD more the data is round(2^n (In - Gnd) / (Ref - Gnd)), Over-range 1 where that is 2^n or more (the data then all 1s); after TPDS more Status goes 0. A rising edge during a conversion, before its data is valid, reads In again and times the data from itself, Status keeping the first edge's timing. Before the first conversion the data and Over-range are X and Status 0. Built as B sources per bit, read by adc_bridges, held at each edge and latched at data valid by XSPICE d_dffs, its UADC delays picked by MNTYMXDLY; the adc-dac probe runs confirm the code, its rounding and over-range, each delay with all three above zero (ADC_TIME2) or all zero (ADC_RAMP2), the reading at the edge (ADC_SAMPLE3) and the restart (ADC_AGAIN3). Convert's falling edge does nothing. Refused until measured: Gnd away from ground; In not driven by one DC or PWL source, or going below Gnd; with delays above zero, Convert not from one Stim, or rising again later in a conversion than its data valid or its TPDS; a zero TPSD or TPDS with other delays set; a model with no typical delay. An exact half step rounds up, and Status and Over-range are never Z: both known differences.

ADC adc16

A 16-bit analog-to-digital converter, pins In, Ref, Gnd, Convert, Status, Over-range, then the data outputs from the most significant bit down.

At each rising edge of Convert it reads In; after the model's TPCS, Status goes to 1; after TPSD more, the data outputs give round(2n · (In − Gnd) / (Ref − Gnd)), with Over-range 1 (and the data all 1s) when that reaches 2n; after TPDS more, Status returns to 0. Before the first conversion the data is X.

Example

With Ref at 5 V, Gnd at 0 V and 2.5 V on In, a 4-bit converter gives 8, binary 1000, at each conversion. Some arrangements not yet checked against Micro-Cap are refused, with a message that names them: Gnd away from ground, or In going below it, among others.

Definition ADC
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_ADC), checked on 4 circuit files against reference results, RMS difference 0.00%.
Technical notes

ADC: In is read at each rising edge of Convert; after TPCS Status goes 1 and the data and Over-range go X; after TPSD more the data is round(2^n (In - Gnd) / (Ref - Gnd)), Over-range 1 where that is 2^n or more (the data then all 1s); after TPDS more Status goes 0. A rising edge during a conversion, before its data is valid, reads In again and times the data from itself, Status keeping the first edge's timing. Before the first conversion the data and Over-range are X and Status 0. Built as B sources per bit, read by adc_bridges, held at each edge and latched at data valid by XSPICE d_dffs, its UADC delays picked by MNTYMXDLY; the adc-dac probe runs confirm the code, its rounding and over-range, each delay with all three above zero (ADC_TIME2) or all zero (ADC_RAMP2), the reading at the edge (ADC_SAMPLE3) and the restart (ADC_AGAIN3). Convert's falling edge does nothing. Refused until measured: Gnd away from ground; In not driven by one DC or PWL source, or going below Gnd; with delays above zero, Convert not from one Stim, or rising again later in a conversion than its data valid or its TPDS; a zero TPSD or TPDS with other delays set; a model with no typical delay. An exact half step rounds up, and Status and Over-range are never Z: both known differences.

DAC dac4

A 4-bit digital-to-analog converter, pins Out, Ref, Gnd, then the data inputs from the most significant bit down.

Its output is Gnd + (Ref − Gnd) · code / 2n, an ideal voltage source. On each change of the code it ramps linearly to the new value over the model's switching time TSW, and an X input counts as half its bit's weight.

Example

With Ref at 5 V and Gnd at 0 V, the code 1000 gives 2.5 V, half of Ref.

Definition DAC
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_DAC), checked on 2 circuit files against reference results, RMS difference 0.00%.
Technical notes

DAC: Out = Gnd + (Ref - Gnd) code / 2^n, an ideal source; on each change of the code Out ramps linearly over TSW from its old value to the new one, and an X input counts as half its weight. Built as a dac_bridge per input bit (0, 1, X as 0.5, ramped over TSW) and a B source of their weighted sum; the adc-dac probe runs confirm the levels, the ramp and the X rule. Its UDAC TSW is picked by MNTYMXDLY; a model with no typical TSW is refused. A Gnd away from 0 V adds as the form says (GND3).

DAC dac8

A 8-bit digital-to-analog converter, pins Out, Ref, Gnd, then the data inputs from the most significant bit down.

Its output is Gnd + (Ref − Gnd) · code / 2n, an ideal voltage source. On each change of the code it ramps linearly to the new value over the model's switching time TSW, and an X input counts as half its bit's weight.

Example

With Ref at 5 V and Gnd at 0 V, the code 1 followed by zeros gives 2.5 V, half of Ref.

Definition DAC
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_DAC), checked on 2 circuit files against reference results, RMS difference 0.00%.
Technical notes

DAC: Out = Gnd + (Ref - Gnd) code / 2^n, an ideal source; on each change of the code Out ramps linearly over TSW from its old value to the new one, and an X input counts as half its weight. Built as a dac_bridge per input bit (0, 1, X as 0.5, ramped over TSW) and a B source of their weighted sum; the adc-dac probe runs confirm the levels, the ramp and the X rule. Its UDAC TSW is picked by MNTYMXDLY; a model with no typical TSW is refused. A Gnd away from 0 V adds as the form says (GND3).

DAC dac16

A 16-bit digital-to-analog converter, pins Out, Ref, Gnd, then the data inputs from the most significant bit down.

Its output is Gnd + (Ref − Gnd) · code / 2n, an ideal voltage source. On each change of the code it ramps linearly to the new value over the model's switching time TSW, and an X input counts as half its bit's weight.

Example

With Ref at 5 V and Gnd at 0 V, the code 1 followed by zeros gives 2.5 V, half of Ref.

Definition DAC
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_DAC), checked on 2 circuit files against reference results, RMS difference 0.00%.
Technical notes

DAC: Out = Gnd + (Ref - Gnd) code / 2^n, an ideal source; on each change of the code Out ramps linearly over TSW from its old value to the new one, and an X input counts as half its weight. Built as a dac_bridge per input bit (0, 1, X as 0.5, ramped over TSW) and a B source of their weighted sum; the adc-dac probe runs confirm the levels, the ramp and the X rule. Its UDAC TSW is picked by MNTYMXDLY; a model with no typical TSW is refused. A Gnd away from 0 V adds as the form says (GND3).

SRFF srff

An SR latch, pins PREB, CLRB, GATE, S, R, Q and QB. While GATE is 1, S sets it and R clears it; S and R together give Q and QB both 1. While GATE is 0 it holds.

Preset (PREB) and clear (CLRB) are active low: a 0 on either forces the output, and both at once give Q and QB both 1; releasing them together leaves the state unknown. The part starts at 0 unless DIGINITSTATE in .OPTIONS says otherwise. Setup and hold violations warn but do not change the result.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition SRFF
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_SRFF), checked on 6 circuit files against reference results, RMS difference 0.00%.
PinsPREB, CLRB, GATE, S, R, Q, QB
Technical notes

Flip-flop or latch: an XSPICE d_jkff, d_dff, d_srlatch or d_dlatch with PREB and CLRB inverted onto its active-high set and reset, JKFF's clock inverted (it changes on the falling edge), and an OR on Q and QB so that preset and clear together, or an SRFF's S and R together with the gate high, give Q and QB both 1, as Micro-Cap does; releasing them gives X. The dig-ff runs confirm the truth tables and toggle, the initial state 0 (DIGINITSTATE 0 or 1 applies), a clock going to X not being an edge, QB taking its own direction's delay, the UEFF delays picked by MNTYMXDLY, and setup and hold violations only warning. A UEFF whose preset and clear delays do not differ from its clock delays by one amount, a UGFF with delays, and an array are refused.

DLTCH latch

A D latch, pins PREB, CLRB, GATE, D, Q and QB. While GATE is 1, Q follows D; when GATE goes to 0, Q holds the last value.

Preset (PREB) and clear (CLRB) are active low: a 0 on either forces the output, and both at once give Q and QB both 1; releasing them together leaves the state unknown. The part starts at 0 unless DIGINITSTATE in .OPTIONS says otherwise. Setup and hold violations warn but do not change the result.

Digital parts simulate with ngspice's event-driven digital models. Their nodes take the states 0, 1 and X (unknown). Where a digital pin meets an analog part, CirSpice adds the standard digital interface (IO_STD): an input reads an analog voltage as a state, and an output drives an analog node through resistances that switch between levels. Delays come from the part's Timing Model, and MNTYMXDLY picks its typical (0), minimum (1), typical (2) or maximum (3) delays. Other I/O models, interface levels and supplies are refused for now.

Definition DLTCH
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_DLTCH), checked on 6 circuit files against reference results, RMS difference 0.00%.
PinsPREB, CLRB, GATE, D, Q, QB
Technical notes

Flip-flop or latch: an XSPICE d_jkff, d_dff, d_srlatch or d_dlatch with PREB and CLRB inverted onto its active-high set and reset, JKFF's clock inverted (it changes on the falling edge), and an OR on Q and QB so that preset and clear together, or an SRFF's S and R together with the gate high, give Q and QB both 1, as Micro-Cap does; releasing them gives X. The dig-ff runs confirm the truth tables and toggle, the initial state 0 (DIGINITSTATE 0 or 1 applies), a clock going to X not being an edge, QB taking its own direction's delay, the UEFF delays picked by MNTYMXDLY, and setup and hold violations only warning. A UEFF whose preset and clear delays do not differ from its clock delays by one amount, a UGFF with delays, and an array are refused.

N Device ndevice

An N device placed as a part, with pins Analog, Low-level, High-level and Digital: the state of the Digital pin's net sets two resistances, from Analog to the Low-level net and to the High-level net, as its DINPUT model gives them for states 0, 1 and X. On a change of state both move linearly to their new values over the state's switching time. It is the same output stage Micro-Cap uses inside a digital part's analog interface.

Definition N
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_N), checked on 5 circuit files against reference results, RMS difference 0.94%.
PinsAnalog, Low-level, High-level, Digital
Technical notes

N device placed as a part: the state of its Digital pin's net sets two resistances, from Analog to its own Low-level net and to its own High-level net, by its DINPUT model (states 0, 1 and X, each with SnRLO, SnRHI and SnTSW), both moving linearly over the new state's switching time, the same N device as inside DTOA_STD. Built as two dac_bridges ramping the resistances, a resistance that falls from state 0 to 1 read from the inverted input (a dac_bridge ramps only upward), and two B sources drawing their currents, with no capacitance (CLO and CHI default to 0). Its digital input starts at the node's operating-point state. Verified against reference results on the Bauman lab's six N device files (community corpus, not in git; runs 20261108T234803Z and 20261109T015136Z): the resting levels match to the printed digits (0.49995 mV and 4.9995 V through DINSTM), and the transient's worst column is 0.94% RMS on circuit7.cir (paw1a and svetalina), 0.78% on 3.2.2, 1.66% on circuit4 and 4.7% on exp8_big, the excess in rows at the end of a 500 ps ramp, where CirSpice's edge comes about 10 ps later, the Stim's own ramp (fleshbound circuit5's 15% is one such row). An IS value, a DINPUT model with CLO, CHI or a state outside 0, 1, R, F, X and Z, and an I/O model other than IO_STD are refused.

Fixed Digital digitalstate

Holds its one pin, Out, at a fixed digital state for the whole run: its Value, 0 or 1. An analog part connected to it sees the standard interface's output levels.

Definition DIGITAL STATE
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STATE), checked on 1 circuit file against reference results, RMS difference 0.00%.
PinsOut
Technical notes

Fixed Digital, DIGITAL STATE: its pin, Out, held at VALUE for the whole run, an XSPICE d_pullup for 1 or d_pulldown for 0, the schematic form of the RM's PULLUP and PULLDN, with the IO_STD I/O model at IO_LEVEL 0 and the DIGIFPWR supply. An analog load reaches it through IO_STD's level 0 DtoA, as a gate's output does (4.35). Verified against reference results on FIX_STATE.cir (packages/engine/test/reference/digital-fixed, run 20261110T162035Z-96f492): a 1 into 1 Meg at 3.4012 V (Micro-Cap 3.401), a 0 into 1 k at 0.199095 V (Micro-Cap 0.199095) and a 1 through an Inverter into 10 k at 0.200315 V (Micro-Cap 0.200315), at 0 and at the run's end. monostable_test.cir's reference run 20261108T223435Z-bb5267 agrees on the states its four VALUE=1 parts give. A VALUE other than 0 or 1, another I/O model, IO_LEVEL or supply are refused.

Animated Digital Switch digitalswitch

The clickable digital switch: in CirSpice it holds its pin, Out, at its State, 0 or 1, for the whole run. In Micro-Cap a click changes the state between runs; change the State in its attribute dialog instead.

Definition DIGITAL SWITCH
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_STATE), checked on 3 circuit files against reference results, RMS difference 0.01%.
PinsOut
Technical notes

Animated Digital Switch, DIGITAL SWITCH: the Fixed Digital with STATE in place of VALUE, its pin, Out, held at STATE for the whole run, an XSPICE d_pullup for 1 or d_pulldown for 0, with the IO_STD I/O model at IO_LEVEL 0 and the DIGIFPWR supply; an analog load reaches it through IO_STD's level 0 DtoA. A click in Micro-Cap only changes STATE between runs. Verified against reference results on DSW0.cir and DSW1.cir (packages/engine/test/reference/digital-switch, runs 20261112T001516Z-0330fa and 20261112T001517Z-0320b7): STATE 0 and 1 into 1 k at 0.1991 V and 3.003 V, and on DLS_STATE.cir (run 20261112T001513Z-740f0a): a 1 into 1 Meg at 3.401 V, a 0 into 1 k at 0.1991 V and a 1 through an Inverter into 10 k at 0.2003 V. Another STATE, I/O model, IO_LEVEL or supply is refused.

Animated Digital LED digitalled

A display that lights on a digital state. It drives nothing; on an analog node it loads the circuit as a digital input does.

Definition DIGITAL LED
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_INPUT), checked on 1 circuit file against reference results, RMS difference 0.03%.
PinsIn
Technical notes

Animated Digital LED, DIGITAL LED: a display on one IO_STD digital input, In, that drives nothing. On an analog node it is the IO_STD AtoD input load, as a gate input is; on a digital node it loads nothing. Verified against reference results on DLED.cir (packages/engine/test/reference/digital-switch, run 20261112T001517Z-76226d): 1 V through 1 Meg into In holds the node at 1.325 V. Another I/O model, IO_LEVEL or supply is refused.

Animated Seven Segment sevensegment

A seven-segment display on seven digital inputs, A to G. It drives nothing; ON STATE picks which level lights a segment in Micro-Cap's display. On analog nodes each input loads the circuit as a digital input does.

Definition SEVEN SEGMENT
SupportSimulated through a CirSpice model built from ngspice parts (IO_STD_INPUT), checked on 1 circuit file against reference results, RMS difference 0.03%.
PinsA, B, C, D, E, F, G
Technical notes

Animated Seven Segment, SEVEN SEGMENT: a display on seven IO_STD digital inputs, A to G, that drives nothing; ON STATE only picks which level lights a segment on screen. Each input on an analog node is the IO_STD AtoD input load; on a digital node it loads nothing. Verified against reference results on DSEG.cir (packages/engine/test/reference/digital-switch, run 20261112T001517Z-b35bbd): 1 V through 1 Meg into A holds the node at 1.325 V. Another I/O model, IO_LEVEL or supply is refused.

Not supported yet (2)

N-Port nport

A network described by S-parameters from a Touchstone file. ngspice has no element that reads Touchstone data, so a circuit with an N-Port opens but cannot run in CirSpice yet.

Definition N_PORT
SupportNot supported yet: a Touchstone N-port has no ngspice element.
Technical notes

N_PORT: S-parameters from a Touchstone file, converted to Y parameters and run as Laplace table sources. Standard ngspice has no Touchstone element.

IGBT igbt

An insulated-gate bipolar transistor, using the Hefner model. ngspice has no IGBT model, so a circuit with one opens but cannot run in CirSpice yet. A subcircuit model of the IGBT from its maker, imported with File > Import Vendor Models, may be able to stand in for it.

Definition IGBT
SupportNot supported yet: the Hefner IGBT model has no ngspice counterpart.
Technical notes

IGBT: the Hefner model.MODEL NIGBT. ngspice has no IGBT model.

Component definitions a file cannot use yet (6)

CirSpice has no part type for these. A file that places one does not open, and the message names the definition and the reason.

DefinitionWhat it isWhy not yet
GaAsFETGaAsFET (spec 4.32a): pins Drain, Gate, Source, a GASFET modelits level 1 is the Curtice model and its level 3 TOM, which ngspice has no element for; level 2 (Statz) is ngspice's MESFET but its capacitances are not compared yet
LTVofVLaplace table source, voltage out of voltage: a table of frequency, dB and degrees (spec 4.32b)how Micro-Cap interpolates the table between its points is not measured: neither linear in dB nor in ratio
FSTIMDigital file stimulus (RM Ch. 27)its states are read from a stimulus file outside the circuit (its FILE), which is not read yet
DLYLINEDigital delay line (RM Ch. 27)a transport delay, which passes a pulse shorter than its delay; every other digital part's delay is inertial and cancels such a pulse, and a transport delay is not built yet
PLANDProgrammable logic AND array (RM Ch. 27)its array is programmed by fuse data (its DATA .DEFINE or a JEDEC FILE), which is not read yet
PLANDCProgrammable logic AND array, true and complement inputs (RM Ch. 27)its array is programmed by fuse data (its DATA .DEFINE or a JEDEC FILE), which is not read yet