E9.7.1 Find the Slow Tail

HardVerifyngspice 42 · serverReview the topic

Write the settling bench for an amplifier used as a buffer. It must pass three sound amplifiers and fail three faulty ones. Two of the faulty ones have a clean Bode plot and a slow tail.

Circuit context: An amplifier wired as a unity-gain buffer in front of a converter: behavioural gain, pole and pole-zero stages, answering a 1 V step. Write the settling sign-off that catches a pole-zero doublet hidden in a clean Bode plot.

A team buys amplifier designs for the buffer in front of a 10-bit converter. The converter samples 0.4 µs after each step, so the buffer must be accurate to 0.1 % by then.

The last amplifier they accepted had 85° of phase margin and reached 1 % in 0.13 µs. In the system it was still 0.5 % out at the sampling instant.

The subcircuit amp in the netlist below is one amplifier, with inputs inp and inn and output out. Your bench wires it as a unity-gain buffer, applies a 1 V step and decides whether it meets the spec.

The grader swaps each design it tests into your amp block and runs your bench. This design and two hidden sound designs must get pass = 1. Three hidden faulty designs must not.

What the Grader Measures

Your bench, with each of these designs swapped into amp; it must print pass = 1 on the good ones and not on the faulty ones.

Requirement your bench checksLimit
Error of the buffer output against its final value, from 0.4 µs after a 1 V step≤ 0.1 %
DesignYour verdict must be
The amplifier in your netlist (poles at 25 Hz and 60 MHz)PASS
A sound amplifier that overshoots by 6.3 % and still settles in 0.16 µsPASS
A sound amplifier with a DC gain of only 800: its final value is 0.99875 VPASS
3 hidden faulty designsFAIL
Full specification
RuleLimitWhere
Settling errorwithin 0.1 % of the final valueat every time from 0.4 µs after the step
The verdict, at the end of your .control block
let pass = ...   * 1 if the design meets the rule, 0 if not
print pass

The step goes from 0 V to 1 V at t = 0 with a 1 ns edge. The final value is the DC output of the buffer for a 1 V input. It differs from design to design.

Every design has finished moving by 6 µs. A sound design may overshoot before 0.4 µs.

A design for which your bench prints no verdict, or whose run stops with an error, counts as FAIL. The designs are built from ideal sources, resistors and capacitors, so no model library is needed.

Examples

Example 1

The Amplifier in the Netlist
Setup
1 V step, buffer, 6 µs
Measured
final value = 0.999995 V
worst error from 0.4 µs = 0.00011 %
pass = 1

The error falls steadily and is inside 0.1 % from 0.203 µs. Nothing happens after the limit.

Example 2

A Sound Amplifier with a Low Gain
Setup
the same bench
Measured
final value = 0.99875 V
worst error from 0.4 µs = 0.0026 %
pass = 1

A gain of 800 leaves the output 0.125 % below the input for ever. That is a gain error. The spec asks only how fast the output reaches its own final value.

Example 3

The Amplifier That Was 0.5 % Out
Setup
the same bench
Measured
final value = 0.999995 V
worst error from 0.4 µs = 0.497 %
pass = 0

The output passes through the band at 0.15 µs, overshoots it and returns only at 0.84 µs. Its phase margin is 84.9° and it reaches 1 % in 0.132 µs.

Constraints and Contract

  • Keep exactly one .subckt amp inp inn out ... .ends block. The grader replaces it with each design it tests, so changes inside it are not graded.
  • The bench sees the design only through its three ports: no nodes or devices inside x instances, no show or altermod.
  • Print the verdict as pass. Any value of at least 0.5 counts as PASS.

Hints

Hint 1

The source line carries DC 1 and a PULSE that starts at 0. An op run uses the DC value, so it gives the final value of each design.

Hint 2

An output can enter the 0.1 % band, leave it on the other side and come back. The first crossing then reports a time that is too short.

Hint 3

meas reads vectors, not expressions. Build the error with let first. meas ... MAX e FROM=... TO=... gives its largest value in a window.

What the grader checks: The grader runs your bench on this amplifier, two hidden sound ones and three hidden faulty ones. It compares your printed verdict with the right one for each design. It grades the decisions, not the numbers you print. Engine: ngspice 42 (libngspice0 42+ds-3build1), measured 2026-11-12 with tools/spice-judge.mjs. The designs are linear models; the bench does not test slewing, clipping or noise.

Run simulates your netlist as written, with your own analyses and measurements. Submit sends it to the grader, which keeps only your bench and makes 6 ngspice runs, one per design. 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 · server