Equations

Level-1 MOSFET equations (Shichman-Hodges) and op-amp performance formulas.

All functions operate on SI units unless the name suffix states otherwise. Consistent units: currents in A, voltages in V, transconductances in A/V (S), dimensions (W, L) in µm (dimensionless ratio W/L is used where needed), frequencies in Hz, power in W.

circuitgenome.sizer.shared.equations.gm(mu_cox, w_um, l_um, ids_a)[source]

Transconductance gm in A/V.

gm = √(2·µCox·(W/L)·|IDS|)

Parameters:
  • mu_cox (float) – Process transconductance µCox in A/V².

  • w_um (float) – Gate width in µm.

  • l_um (float) – Gate length in µm.

  • ids_a (float) – Drain-source current in A (sign ignored).

Return type:

float

circuitgenome.sizer.shared.equations.gm_ceiling(ids_a)[source]

Physical upper bound on gm in A/V (weak-inversion limit).

Parameters:

ids_a (float)

Return type:

float

circuitgenome.sizer.shared.equations.gd(lam, ids_a)[source]

Output conductance gd in A/V.

gd = λ·|IDS|

Parameters:
  • lam (float) – Channel-length modulation coefficient λ in 1/V (positive).

  • ids_a (float) – Drain-source current in A.

Return type:

float

circuitgenome.sizer.shared.equations.rout(gd_top, gd_bot)[source]

Stage output resistance in Ω.

Rout = 1 / (gd_top + gd_bot)

Parameters:
  • gd_top (float) – Output conductance of the upper (load) transistor in A/V.

  • gd_bot (float) – Output conductance of the lower (drive) transistor in A/V.

Return type:

float

circuitgenome.sizer.shared.equations.vgs_from_ids(mu_cox, w_um, l_um, ids_a, vth)[source]

Gate-source voltage in V (saturation, λ=0 approximation).

Solves IDS = (µCox/2)·(W/L)·(VGS−Vth)² for VGS. Returns a signed value: positive for NMOS, negative for PMOS.

Parameters:
Return type:

float

circuitgenome.sizer.shared.equations.vds_sat(mu_cox, w_um, l_um, ids_a)[source]

Minimum |VDS| for saturation in V.

VDS_sat = VGS − Vth = √(2·|IDS|·L / (µCox·W))

Returns:

Always positive.

Parameters:
Return type:

float

circuitgenome.sizer.shared.equations.open_loop_gain_db(stage_gains)[source]

Total open-loop DC gain in dB.

A0 = Π(gm_j · Rout_j), converted to dB.

Parameters:

stage_gains (list[float]) – List of per-stage voltage gains (dimensionless).

Return type:

float

circuitgenome.sizer.shared.equations.unity_gain_bw(gm1_a_v, cc_f)[source]

Unity-gain bandwidth (GBW) in Hz.

GBW = gm1 / (2π·Cc)

Parameters:
  • gm1_a_v (float) – Input-pair transconductance in A/V.

  • cc_f (float) – Compensation capacitor in F.

Return type:

float

circuitgenome.sizer.shared.equations.phase_margin_two_stage_deg(gm1, gm2, cc_f, cl_f)[source]

Phase margin in degrees (dominant-pole approximation).

PM ≈ 90° − arctan(gm1·CL / (gm2·Cc))

Valid when the dominant pole is at 1/(Rout1·Cc) and the non-dominant pole is at gm2/CL (internal mirror pole neglected).

Parameters:
  • gm1 (float) – Input-pair gm in A/V.

  • gm2 (float) – Second-stage signal transistor gm in A/V.

  • cc_f (float) – Compensation capacitor in F.

  • cl_f (float) – Output load capacitance in F.

Return type:

float

circuitgenome.sizer.shared.equations.phase_margin_three_stage_deg(gm1, gm2, gm3, cc1_f, cc2_f, cl_f)[source]

Phase margin in degrees for three-stage NMC/RNMC (two non-dominant poles).

PM ≈ 90° − arctan(ωt·Cc2/gm2) − arctan(ωt·CL/gm3) where ωt = gm1/Cc1.

Parameters:
  • gm1 (float) – Input-pair transconductance in A/V.

  • gm2 (float) – Second-stage signal transistor gm in A/V.

  • gm3 (float) – Third-stage signal transistor gm in A/V.

  • cc1_f (float) – Outer (primary) compensation capacitor in F.

  • cc2_f (float) – Inner compensation capacitor in F (Cc2 = Cc1/4 by default).

  • cl_f (float) – Output load capacitance in F.

Return type:

float

circuitgenome.sizer.shared.equations.slew_rate_vps(ibias_a, cc_f)[source]

Slew rate in V/s.

SR = IBias / Cc (limited by tail-current charging/discharging Cc)

Parameters:
  • ibias_a (float) – Tail bias current in A.

  • cc_f (float) – Compensation capacitor in F.

Return type:

float

circuitgenome.sizer.shared.equations.quiescent_power(vdd, vss, supply_currents_a)[source]

Total quiescent power in W.

P = (VDD − VSS) · Σ|IDS_supply|

Parameters:
  • supply_currents_a (list[float]) – Currents drawn from the positive supply (before summing, absolute values are taken).

  • vdd (float)

  • vss (float)

Return type:

float

circuitgenome.sizer.shared.equations.cmrr_db(gm1, gd_tail)[source]

Common-mode rejection ratio in dB (first-order approximation).

CMRR ≈ gm1 / (2·gd_tail)

Parameters:
  • gm1 (float) – Input-pair transconductance in A/V.

  • gd_tail (float) – Output conductance of the tail current source in A/V.

Return type:

float

circuitgenome.sizer.shared.equations.psrr_db_approx(gm2, gd_bias)[source]

Positive-supply PSRR rough approximation in dB.

PSRR+ ≈ gm2 / gd_bias_mirror

This is a first-order estimate valid for simple two-stage opamps; accurate PSRR requires simulation.

Parameters:
  • gm2 (float) – Second-stage signal transistor gm in A/V.

  • gd_bias (float) – Output conductance of the second-stage bias transistor in A/V.

Return type:

float