Sample and hold: the switch, charge injection and kT/C
Measure the three errors a MOS switch adds to a sample-and-hold, its input-dependent resistance, the step it leaves when it opens and the noise it freezes, and see which cures work.
- Lesson
- E8.2
- Time
- 30 min
- Runs on
- ngspice
- Check
- 5 questions
An ADC's input stage simulated cleanly with an ideal switch, then grew harmonics with a transistor switch. Every time the switch opened, it left a small step on the hold capacitor, and the step depended on the input.
- input 0.2 V
- input 0.5 V
- input 0.8 V
- clock
- Time 900 psinput 0.2 V = -201.2 pV · input 0.5 V = -741.1 pV · input 0.8 V = -4.223 nV · clock = 1.8 V
Tracking: each hold node equals its input, so every error is zero.
- Time 1.1 nsinput 0.2 V = -903.2 µV · input 0.5 V = -734.8 µV · input 0.8 V = -575.7 µV · clock = 0 V
The gate falls in 0.1 ns and the switch opens. Each hold node jumps down.
- Time 3 nsinput 0.2 V = -903.3 µV · input 0.5 V = -734.9 µV · input 0.8 V = -575.8 µV · clock = 0 V
Held: −0.903 mV at 0.2 V, −0.735 mV at 0.5 V, −0.576 mV at 0.8 V. The step shrinks as the input rises.
Read the plot as a table
| Time | input 0.2 V | input 0.5 V | input 0.8 V | clock |
|---|---|---|---|---|
| 0 s | -201.2 pV | -741.1 pV | -4.311 nV | 1.8 V |
| 500 ps | -201.2 pV | -741.1 pV | -4.26 nV | 1.8 V |
| 900 ps | -201.2 pV | -741.1 pV | -4.223 nV | 1.8 V |
| 1 ns | -201.2 pV | -741.1 pV | -4.215 nV | 1.8 V |
| 1.1 ns | -903.2 µV | -734.8 µV | -575.7 µV | 0 V |
| 1.5 ns | -903.3 µV | -734.9 µV | -575.8 µV | 0 V |
| 2 ns | -903.3 µV | -734.9 µV | -575.8 µV | 0 V |
| 2.5 ns | -903.3 µV | -734.9 µV | -575.8 µV | 0 V |
| 3 ns | -903.3 µV | -734.9 µV | -575.8 µV | 0 V |
Measured on ngspice 42 with SKY130 devices (the lab netlist).
A step that depends on the signal bends the transfer curve, and a bent curve makes harmonics.
Track, then hold
A sample-and-hold (S/H) is a switch and a capacitor CH. While the switch is on, CH follows the input: track. When it opens, CH keeps the last value: hold. An ADC then has the whole hold time to convert a value that no longer moves.
- Track
The gate is at 1.8 V and M1 is a resistor of 1.30 kΩ at a 0.5 V input. CH follows the input with a time constant RonCH of about 1.3 ns.
- The gate falls
The channel's charge must leave, and the gate's overlap capacitance couples the falling edge to both ends. With a 0.1 ns edge the total splits evenly: −0.735 fC onto CH and −0.737 fC back into the input source.
−0.737 fC · −0.735 fC
- Hold
M1 is off. CH keeps 0.5 V minus 0.735 mV: the pedestal, the step the switch left.
Read the circuit as text
- V_in voltage source (0.5 V): + →
n1, − →0 - M1 NMOS transistor (W/L = 1/0.15): gate →
n2, drain →n3, source →n1 - clock port: terminal →
n2 - C_H capacitor (1 pF): pin 1 →
n3, pin 2 →0 - hold port: terminal →
n3
Charge labels are measured on the lab's switch A. The NMOS body is at ground.
A MOS switch adds three errors to that ideal picture: a resistance that changes with the input, a step when it opens, and noise frozen on CH.
The switch's resistance follows the input
An NMOS switch conducts like a resistor Ron ≈ 1/(μCox(W/L)(VGS − Vth)). Its gate sits at 1.8 V, so VGS = 1.8 V − Vin shrinks as the input rises. The body effect raises Vth at the same time.
- NMOS
- transmission gate
- bootstrapped
- Input 200 mVNMOS = 808.9 Ω · transmission gate = 808.9 Ω · bootstrapped = 688 Ω
At 0.2 V the NMOS is 809 Ω. At 0.5 V it is 1.30 kΩ.
- Input 900 mVNMOS = 13.3 kΩ · transmission gate = 9.875 kΩ · bootstrapped = 743.7 Ω
At 0.9 V it is 13.3 kΩ, and it passes 100 kΩ at 1.01 V. Above that the NMOS is off: 524 MΩ at 1.3 V.
- Input 960 mVNMOS = 35.23 kΩ · transmission gate = 12.31 kΩ · bootstrapped = 747.1 Ω
The transmission gate stays finite, but peaks at 12.3 kΩ here: SKY130 thresholds are near half the supply, so both devices are barely on.
- Input 1.8 VNMOS = 8394 TΩ · transmission gate = 1.491 kΩ · bootstrapped = 777.8 Ω
The bootstrapped gate rides 1.8 V above the input, so VGS stays constant: 744 Ω at 0.9 V, 778 Ω at 1.8 V.
Read the plot as a table
| Input | NMOS | transmission gate | bootstrapped |
|---|---|---|---|
| 0 V | 665.6 Ω | 665.6 Ω | 665.6 Ω |
| 200 mV | 808.9 Ω | 808.9 Ω | 688 Ω |
| 400 mV | 1.071 kΩ | 1.071 kΩ | 707.2 Ω |
| 600 mV | 1.695 kΩ | 1.695 kΩ | 723.6 Ω |
| 800 mV | 4.554 kΩ | 4.434 kΩ | 737.5 Ω |
| 900 mV | 13.3 kΩ | 9.875 kΩ | 743.7 Ω |
| 960 mV | 35.23 kΩ | 12.31 kΩ | 747.1 Ω |
| 1 V | 78.73 kΩ | 11.14 kΩ | 749.3 Ω |
| 1.2 V | 20.74 MΩ | 4.299 kΩ | 759 Ω |
| 1.4 V | 13.99 GΩ | 2.538 kΩ | 766.9 Ω |
| 1.6 V | 10.58 TΩ | 1.846 kΩ | 773.1 Ω |
| 1.8 V | 8394 TΩ | 1.491 kΩ | 777.8 Ω |
Measured on ngspice 42. The plot clips at 1 GΩ.
Ron sets the tracking bandwidth 1/(2πRonCH). With 1 pF the run measures 165.6 MHz at 0.2 V and 33.7 MHz at 0.8 V. The formula with the plotted Ron gives 196.8 and 35.0 MHz; the gap is about 150 Ω of source and drain resistance that the model adds in series and gds leaves out. A bandwidth that depends on the input is distortion too.
A transmission gate puts a PMOS beside the NMOS, so one of them conducts near each rail. A bootstrapped switch holds VGS at the supply by riding a charged capacitor on the input; the ideal one above shows what it buys.
Charge injection and clock feedthrough
While the switch is on, its channel holds a charge Qch ≈ W L Cox(VGS − Vth). When the gate falls, that charge leaves through both ends. The part that lands on CH is charge injection. The gate-to-source overlap capacitance also couples the gate's swing onto CH: clock feedthrough. Both pull the held value down for an NMOS.
The step is ΔV ≈ −(k·Qch + Cov·Vclk)/CH, where k is the share of the charge that reaches CH. The lab measures every scaling at once.
| Switch A and its variants | Pedestal | Compared with A |
|---|---|---|
| A: W = 1 µm, CH = 1 pF, input 0.5 V | −0.735 mV | 1 |
| B: W = 4 µm | −3.019 mV | 4.1 × |
| C: CH = 4 pF | −0.184 mV | 1/4.0 |
| D: input 0.2 V | −0.903 mV | 1.23 × |
| E: input 0.8 V | −0.576 mV | 0.78 × |
All from the lab netlist on ngspice 42. A wider switch has more channel charge; a bigger CH spreads it thinner.
The input rows matter most. The gate charge measured at the operating point is 1.65 fC at 0.2 V, 1.40 fC at 0.5 V and 1.16 fC at 0.8 V: less VGS, less charge. A step that changes with the input is distortion; a constant one would only be an offset.
Cures: a dummy switch and a transmission gate
A dummy switch is a half-width transistor with its drain and source both on the hold node, driven by the inverse clock. As the main switch opens, the dummy turns on and soaks up about the charge that half of the main channel dumps.
The switch alone
XA ia ga ha 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
CA ha 0 1p
ped_a = -7.348997e-04: −0.735 mV.
With a half-width dummy
XG ig g hg 0 sky130_fd_pr__nfet_01v8 W=1 L=0.15
XGD hg gb hg 0 sky130_fd_pr__nfet_01v8 W=0.5 L=0.15
CG hg 0 1p
ped_g = -1.455047e-06: −1.5 µV, 500 times smaller.
Both in the lab netlist on ngspice 42; gb is the inverse clock.
- switch alone
- with dummy
- transmission gate
- clock g
- Time 3 nsswitch alone = -734.9 µV · with dummy = -1.455 µV · transmission gate = -472.1 µV · clock g = 0 V
Held: −0.735 mV alone, −0.472 mV as a transmission gate, −1.5 µV with the dummy.
Read the plot as a table
| Time | switch alone | with dummy | transmission gate | clock g |
|---|---|---|---|---|
| 0 s | -741.1 pV | -2.223 nV | 1.162 nV | 1.8 V |
| 500 ps | -741.1 pV | -2.223 nV | 1.162 nV | 1.8 V |
| 1 ns | -741.1 pV | -2.223 nV | 1.162 nV | 1.8 V |
| 1.5 ns | -734.9 µV | -1.453 µV | -472.1 µV | 0 V |
| 2 ns | -734.9 µV | -1.454 µV | -472.1 µV | 0 V |
| 2.5 ns | -734.9 µV | -1.454 µV | -472.1 µV | 0 V |
| 3 ns | -734.9 µV | -1.455 µV | -472.1 µV | 0 V |
Measured on ngspice 42 (the lab netlist).
The transmission gate helps less: its PMOS dumps positive charge that cancels only part of the NMOS's, and the two charges change with the input in opposite ways. The dummy's cancellation assumes an even split, which holds for a fast edge like this one. Bottom-plate sampling, which opens a switch on the grounded side of CH first, is the other standard cure.
kT/C: the noise frozen on the capacitor
The switch's resistance makes thermal noise, which CH filters while tracking. When the switch opens, CH keeps whatever noise voltage it had at that instant, the kT/C noise of E7.2 kT/C: the noise you cannot design away. Its rms value is √(kT/CH), whatever Ron is: a larger Ron makes more noise density but a lower bandwidth, and the two cancel.
On 1 pF at 27 °C the formula gives 64.37 µV. A 1.304 kΩ resistor measures 64.35 µV. The 1 µm switch measures 59.75 µV and the 4 µm switch, with a quarter of the resistance, 59.44 µV. So the width hardly matters. The SKY130 transistor model gives about 7 % less than the resistor; design with √(kT/CH), the larger number.
Together the pedestal and kT/C set the smallest CH: big enough for noise and injection. The driver must still charge it within the track time, which sets the largest (E8.4 Design it, then break it: a DAC output buffer).
What the digital side sees
A behavioural S/H model in a mixed-signal bench is usually held = vin at the clock edge, sometimes plus Gaussian noise of fixed rms. The runs add a step that depends on the input: −0.903 mV at 0.2 V to −0.576 mV at 0.8 V here. They also add a tracking bandwidth that falls as the input rises. A model that adds only noise passes tests that the real switch fails.
Asked in interviews
What is charge injection and how do you reduce it?
When a MOS switch turns off, its channel charge W L Cox(VGS − Vth) leaves through both ends, and the part on the hold capacitor is a step. It depends on the input. Cures: a half-width dummy switch on the inverse clock, a larger CH, a narrower switch, bottom-plate sampling, differential circuits.
Why use a transmission gate or a bootstrapped switch?
An NMOS switch's Ron grows as the input rises, until it turns off near VDD − Vth. A transmission gate adds a PMOS that conducts near the top. A bootstrapped switch keeps VGS at VDD for any input, so Ron stays almost constant.
What limits the size of a sampling capacitor?
From below: kT/C noise, √(kT/C), and the charge-injection step, both smaller with a bigger C. From above: the driver and switch must settle C within the track time, and a bigger C needs more current or a wider switch.
Try it
Run the netlist. Each ped_* line is one switch's hold error 2 ns after it opened. q_back is the charge that flowed back into A's input source while the gate fell; A's pedestal times 1 pF is the charge on CH.
Predict, then run. Slow A's clock edge from 0.1 ns to 5 ns in VGA (and run longer): more of the channel charge has time to flow back to the source, so ped_a should shrink a little. Give the dummy the full 1 µm width and the step should turn positive. Raise VA to 1.2 V, where the NMOS is nearly off: the step shrinks, but the switch could no longer follow a moving input.
Run the netlist to draw its plots here.
ped_a = -7.348997e-04 ped_b = -3.019058e-03 ped_c = -1.840032e-04 ped_d = -9.033468e-04 ped_e = -5.758039e-04 ped_f = -7.499039e-04Check yourself
Remember
- An NMOS switch's Ron grows as the input rises (1.30 kΩ at 0.5 V, 13.3 kΩ at 0.9 V here) and it turns off near VDD − Vth; a transmission gate or a bootstrapped gate keeps it finite.
- When the switch opens, channel charge and clock feedthrough leave a step ΔV ≈ −(k·Qch + CovVclk)/CH: proportional to W, inverse to CH, and larger at low inputs.
- An input-dependent step is distortion, not offset; a half-width dummy on the inverse clock cancels most of it for a fast edge.
- The noise frozen on CH is √(kT/CH) whatever Ron is: about 64 µV on 1 pF.
- A behavioural S/H model needs the input-dependent step and the bandwidth, not only noise.