E10.6.1 Buy 16.7 dB of Linearity

MediumImplementngspice 42 + SKY130 · serverReview the topic

A gain block has 40 dB of gain and too much third-harmonic distortion. Give up 20 dB of that gain to build a clean gain-of-10 stage, without adding more than 10 % to its input noise.

Circuit context: A SKY130 gain block (a differential pair with a mirror load and a source follower, gain 109) in a sensor channel that needs a gain of 10, from a 1.8 V supply. Build a gain-of-10 stage that trades gain for linearity without paying for it in noise.

A sensor channel needs a gain of 10 at 100 kHz. The team has one gain block, gb, with a gain of about 109. Used without a loop for a 0.2 V output, it shows −48.6 dBc of third harmonic. The channel needs −60 dBc.

The first prototype in the netlist uses all of the block's gain. Two resistors hold its DC level and do nothing for signals. Turn the subcircuit stage into a gain of 10 that meets every line of the spec.

You may use resistors, capacitors, one bias current source and the block gb. You may not change the block. Its bias current enters at the pin ib.

What the Grader Measures

Your subcircuit stage (ports in, out, vdd, ref) under the grader's own bench, one run per corner (tt, ss, ff):

CheckCornerRule
Gain at 1 kHztt9.8 to 10.2
HD3 at 100 kHztt≤ -60 dB
Input-referred noise at 100 kHztt≤ 44.7 nV/rtHz
Supply currenttt≤ 45 µA
Gain at 1 kHzss9.8 to 10.2
HD3 at 100 kHzss≤ -60 dB
Gain at 1 kHzff9.8 to 10.2
HD3 at 100 kHzff≤ -60 dB
Full specification
The subcircuit the grader tests (keep the name and the ports)
.subckt stage in out vdd ref
* resistors, capacitors, current sources and X instances of gb
.ends
CheckCornerRuleHow the grader measures it
Gain at 1 kHztt, ss, ff9.8 to 10.2ac: |v(out)| with AC 1 on the input
HD3 at 100 kHztt, ss, ff≤ −60 dBctran: 20 mV, 100 kHz at the input; third harmonic of v(out) against the tone
Input-referred noise at 100 kHztt≤ 44.7 nV/√Hznoise: referred to the input source
Supply currenttt≤ 45 µAop: the current out of the 1.8 V source

The block alone has 40.64 nV/√Hz of input noise at 100 kHz. The noise limit is that value plus 10 %.

The grader runs its bench three times, with .lib sky130 tt, ss and ff, at 27 °C. The input and the pin ref both rest at 0.7 V, and the load is 1 pF.

Examples

Example 1

The Starter: The Block Open Loop
Design
.subckt stage in out vdd ref
* the bias current of the gain block
IB vdd nb 10u
* the gain block, open loop for signals: RS and CS hold the DC level only
XA in fb out vdd nb gb
RS out fb 10meg
CS fb ref 100n
.ends
Measured by the grader
Gain at 1 kHz: 109.2 (needs 9.8 to 10.2)
HD3 at 100 kHz: -11.55 dB (needs ≤ -60 dB)
Input-referred noise at 100 kHz: 40.64 nV/rtHz (needs ≤ 44.7 nV/rtHz)
Supply current: 39.35 µA (needs ≤ 45 µA)
Gain at 1 kHz at ss: 108.4 (needs 9.8 to 10.2)
HD3 at 100 kHz at ss: -11.5 dB (needs ≤ -60 dB)
Gain at 1 kHz at ff: 109.7 (needs 9.8 to 10.2)
HD3 at 100 kHz at ff: -11.6 dB (needs ≤ -60 dB)

The gain is 109, so the 20 mV test tone asks for more than 2 V of output and the stage clips. The noise and the current pass. No gain has been traded yet.

Example 2

No Loop: A Divider at the Input, Then the Block
Design
.subckt stage in out vdd ref
* a 10.9 : 1 divider at the input, then the block open loop
IB vdd nb 10u
RA in mid 99k
RB mid ref 10k
XA mid fb out vdd nb gb
RS out fb 10meg
CS fb ref 100n
.ends
Measured by the grader
Gain at 1 kHz: 10.02 (needs 9.8 to 10.2)
HD3 at 100 kHz: -48.61 dB (needs ≤ -60 dB)
Input-referred noise at 100 kHz: 462.7 nV/rtHz (needs ≤ 44.7 nV/rtHz)
Supply current: 39.35 µA (needs ≤ 45 µA)
Gain at 1 kHz at ss: 9.949 (needs 9.8 to 10.2)
HD3 at 100 kHz at ss: -46.85 dB (needs ≤ -60 dB)
Gain at 1 kHz at ff: 10.06 (needs 9.8 to 10.2)
HD3 at 100 kHz at ff: -50.18 dB (needs ≤ -60 dB)

The divider brings the gain to 10 without a loop. The block still makes its open-loop distortion, and the divider's resistors add noise at the input.

Example 3

A Loop with the Ideal Ratio: 90 kΩ and 10 kΩ
Design
.subckt stage in out vdd ref
* the bias current of the gain block
IB vdd nb 10u
XA in fb out vdd nb gb
* the feedback network
RF out fb 90k
RG fb ref 10k
.ends
Measured by the grader
Gain at 1 kHz: 9.15 (needs 9.8 to 10.2)
HD3 at 100 kHz: -67.62 dB (needs ≤ -60 dB)
Input-referred noise at 100 kHz: 42.44 nV/rtHz (needs ≤ 44.7 nV/rtHz)
Supply current: 38.85 µA (needs ≤ 45 µA)
Gain at 1 kHz at ss: 9.147 (needs 9.8 to 10.2)
HD3 at 100 kHz at ss: -65.85 dB (needs ≤ -60 dB)
Gain at 1 kHz at ff: 9.151 (needs 9.8 to 10.2)
HD3 at 100 kHz at ff: -69.15 dB (needs ≤ -60 dB)

The distortion and the noise now pass. The gain does not: with a loop gain near 10, about one part in eleven of the ideal gain is lost.

Constraints and Contract

  • The netlist defines .subckt stage in out vdd ref ... .ends exactly once, with these ports in this order.
  • Inside stage: resistors, capacitors, current sources and X instances of gb, with comments and .param lines. No transistors and no voltage sources.
  • The grader writes the .lib line and the gb block itself. Everything outside stage is replaced by its bench.

Hints

Hint 1

Distortion falls with loop gain, and loop gain is the gain you give up. How much gain can this stage give up?

Hint 2

With a loop gain near 10, the closed-loop gain is well below the resistor ratio. Count the factor T/(1 + T).

Hint 3

The two resistors act as one resistor in series with the input. Work out how large it may be before its noise uses up the 10 %.

Hint 4

The follower inside the block must drive the network. Check the supply current and the gain when the network is small.

What the grader checks: The grader places stage under its own bench with the gain block gb. The supply is 1.8 V, the input and ref rest at 0.7 V, and the load is 1 pF. It measures the gain, the third harmonic of a 20 mV tone at 100 kHz, the input-referred noise and the supply current. The harmonic comes from four whole periods of a transient run. Corners are tt, ss and ff at 27 °C. Engine: ngspice 42 (libngspice0 42+ds-3build1) with the lean SKY130 library, measured 2026-11-12 with tools/spice-judge.mjs. It does not check other signal levels, stability margins, temperature or mismatch.

Run simulates your netlist as written, with your own analyses and measurements. Submit sends it to the grader, which keeps only the subcircuit stage and makes 3 ngspice runs. The numbers come from ngspice and the SKY130 models the site pins; they prove the measured cases, not every condition a chip meets.

See all 1 steps and the final capstone

Report a problem with this page

Your netlist SPICESaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs
Not run yet
Run your netlist to see its measurements and the ngspice log here.
ngspice 42 + SKY130 · server