ADC and DAC resolution, LSB and error budget calculator
A converter's bits say how many codes it has; its datasheet's offset, gain, INL and DNL say how many of them mean anything. TI's SLAA013 defines each of the four static errors and their sum, the ½ LSB every ADC carries from quantization, the 6.02n + 1.76 dB that follows from it, and the input frequency an aperture uncertainty allows. Enter the bits, the range and the datasheet's error lines to get the LSB in volts, each error in volts and per cent of full scale, the worst-case total and the resolution it actually leaves, the ideal and worst-case SNR, the aperture frequency limit, and the Nyquist rate for the input.
An ADC carries ± ½ LSB of quantization error in its total; a DAC's output is a point on a step and does not. SLAA013 §3.5.
Resolution in bits: 2ⁿ codes. SLAA013 divides the full-scale range into 2ⁿ − 1 step widths, because the first and last steps are half width.
Full-scale range: the reference, or the span between the two end codes. 1 LSB = FSR / (2ⁿ − 1).
Offset error from the datasheet, in LSB: "the difference between the nominal and actual offset points", the same for every code.
Gain error in LSB, measured after the offset is removed: the slope error, "the same percentage error in each step".
Integral nonlinearity in LSB: the worst deviation of the transfer function from the end-point straight line once offset and gain are removed.
Differential nonlinearity in LSB: the worst error in a single step width. Over 1 LSB the converter can be non-monotonic or miss codes. Not summed into the total — it is already inside the INL.
Aperture uncertainty of the sample-and-hold, or the clock jitter, in nanoseconds. SLAA013 §4 wants its effect under ½ LSB at the steepest point of the input sine. 0 ignores it.
Highest input frequency of interest, kHz. Sets the Nyquist rate and is checked against the aperture limit.
- Codes · 1 LSB (FSR / (2ⁿ − 1)) · as % of FSR
- 4,096 · 806 µV · 0.0244 %
- Offset · gain · INL · DNL, in volts
- 806 µV · 1.61 mV · 806 µV · 403 µV
- Total error incl. ½ LSB quantization · useful bits
- 4.5 LSB = 3.63 mV = 0.110 % FSR · 8.8 of 12
- SNR, full-scale sine: ideal · worst case with ½ LSB DNL
- 74.0 dB · 68.0 dB
- Nyquist rate for 10.0 kHz
- 20.0 kHz minimum sample rate
- Aperture 1.00 ns: highest sine at ½ LSB · aperture for 10.0 kHz
- 38.9 kHz · 3.89 ns
SLAA013's four static errors "can be completely described by just four terms" — offset, gain, INL and DNL — and this converter's worst-case sum is 4.5 LSB, so of its 12 bits about 8.8 carry information about the input; the rest resolve the converter's own error. Offset and gain "can usually be compensated for by a trimming process" or a calibration, which leaves the INL and the ½ LSB.
The 74.0 dB is the quantization-noise limit for a full-scale sine, SLAA013's 6.02n + 1.76 dB; the 68.0 dB is its worst case for a ½ LSB DNL error, one bit lost. A real datasheet's SINAD and ENOB, and what the FFT floor means, are the ADC noise floor calculator's subject.
How this is calculated
Standard: TI SLAA013
- SLAA013 §2: the end steps are half width, so the range holds 2ⁿ − 1 full steps. Quantization error is ± ½ LSB.
- §3.5: absolute accuracy "includes offset, gain, and integral linearity errors and also the quantization error in the case of an ADC". Worst-case sum; DNL is inside the INL.
- The bits left once the total error is one code's worth of uncertainty; equals n for an ideal ADC.
- §5: quantization noise q²/12 against a full-scale sine, and the one-bit loss a ½ LSB DNL error (a missing code) causes.
- §4: the aperture uncertainty T_A must move a full-scale sine by less than ½ LSB at its zero crossing.
- §6: Nyquist. The anti-alias filter needs margin above it.
Assumptions
- Errors are entered as magnitudes in LSB, as datasheets give them, and summed worst-case with the same sign.
- INL is end-point linearity, SLAA013's "usual definition"; a best-fit INL is smaller for the same converter.
- The SNR figures are for an ideal converter and a full-scale sine; reference noise, driver noise and clock jitter are not included.
- The aperture limit treats T_A as a fixed uncertainty window on a full-scale sine.
- Dynamic specifications (SINAD, ENOB, THD, SFDR) are not computed here.
What sets a converter's resolution and accuracy
Resolution and accuracy are different numbers, and the datasheet gives both. Resolution is the bit count: "an ADC with an n-bit resolution has 2ⁿ possible digital codes which define 2ⁿ step levels", and SLAA013 divides the full-scale range into 2ⁿ − 1 step widths because "the first (zero) step and the last step are only one half of a full width". One step is 1 LSB, "often used as the reference unit for other quantities in the specification", and an ideal ADC is wrong by up to half of it on every conversion — the "inherent quantization error (± 1/2 LSB)". A DAC "can be thought of as a digitally controlled potentiometer": its transfer function is points on the ideal line, and 1 LSB is the height of a step.
Accuracy is how far the real transfer function sits from that ideal staircase, and SLAA013's claim is that four numbers cover it: static errors "can be completely described by just four terms. These are offset error, gain error, integral nonlinearity and differential nonlinearity." Offset moves every code by the same amount; gain is a slope error, "the same percentage error in each step"; DNL is the error in one step's width or height, and "if the DNL exceeds 1 LSB, there is a possibility that the converter can become nonmonotonic"; INL is the deviation from a straight line — end-point by convention — and "the summation of the differential nonlinearities from the bottom up to a particular step, determines the value of the integral nonlinearity at that step". Absolute accuracy, the total error, "includes offset, gain, and integral linearity errors and also the quantization error in the case of an ADC", which is why the calculator sums those and not the DNL.
Two more limits come from the bits alone. The quantization noise of an ideal converter is q²/12, and against a full-scale sine that is "SNR = 6.02n + 1.76 dB", so "each extra 1 bit of resolution provides approximately 6 dB improvement"; a ½ LSB DNL error is a missing code, "equivalent to a reduction of 1 bit of resolution", so the worst case is 6.02n − 4.24 dB. And the sample-and-hold's aperture uncertainty TAhas to move a sine by less than ½ LSB at its steepest point, which gives fmax = 1 / (TA π 2ⁿ⁺¹): the input frequency a converter can resolve to its own resolution falls by half for every bit.
ADC resolution chart: what one LSB is worth
The ideal converter at each common resolution, computed by the calculator above with every datasheet error set to zero: the number of codes, the size of one code on a 3.3 V and a 5 V full scale, and the signal-to-noise ratio that quantisation alone allows, 6.02n + 1.76 dB. The datasheet's offset, gain, INL and DNL come off these figures, which is what the calculator is for.
| Resolution | Codes | 1 LSB at 3.3 V | 1 LSB at 5 V | 1 LSB, % of FSR | Ideal SNR |
|---|---|---|---|---|---|
| 8-bit | 256 | 12.9 mV | 19.6 mV | 0.39 % | 49.9 dB |
| 10-bit | 1,024 | 3.23 mV | 4.89 mV | 0.098 % | 62.0 dB |
| 12-bit | 4,096 | 806 µV | 1.22 mV | 0.024 % | 74.0 dB |
| 14-bit | 16,384 | 201 µV | 305 µV | 0.0061 % | 86.0 dB |
| 16-bit | 65,536 | 50.4 µV | 76.3 µV | 0.0015 % | 98.1 dB |
| 18-bit | 262,144 | 12.6 µV | 19.1 µV | 0.00038 % | 110.1 dB |
| 20-bit | 1,048,576 | 3.15 µV | 4.77 µV | 0.000095 % | 122.2 dB |
| 24-bit | 16,777,216 | 197 nV | 298 nV | 0.0000060 % | 146.2 dB |
From the 16-bit row down the LSB is tens of microvolts or less, which is under the noise on most 3.3 V rails and under the offset of most op amps. A 24-bit converter has 24 bits of codes, not 24 bits of accuracy; the bottom rows are where the noise-floor page takes over.
Worked example: a 12-bit ADC on 3.3 V with datasheet errors
The defaults: 12 bits over 3.3 V, with 1 LSB of offset, 2 LSB of gain error, 1 LSB of INL and 0.5 LSB of DNL, 1 ns of aperture uncertainty, and a 10 kHz input.
codes 2¹² = 4096
1 LSB 3.3 V / 4095 = 806 µV (0.0244 % FSR)
quantization ± ½ LSB = ± 403 µV
offset, gain 1 LSB, 2 LSB = 806 µV, 1.61 mV
INL, DNL 1 LSB, 0.5 LSB = 806 µV, 403 µV
total (ADC) 1 + 2 + 1 + ½ = 4.5 LSB = 3.63 mV = 0.110 % FSR
useful bits log2(4096 / (2 × 4.5)) = 8.8 of 12
SNR 6.02 × 12 + 1.76 = 74.0 dB ideal, 68.0 dB with a ½ LSB DNL
aperture 1 / (1 ns × π × 2¹³) = 38.9 kHz highest sine at ½ LSB; 10 kHz is inside
Nyquist 2 × 10 kHz = 20 kHz minimum sample rate
The 12-bit label is true and the 8.8 is what the input gets: before any calibration, the converter's own errors are worth 4.5 of its steps. The offset and the gain — three of those LSB — are the correctable part, "usually adjusted to zero by trimming" in SLAA013's words or by a two-point calibration in firmware; the INL and the quantization are not, which is what a datasheet's "INL" line is worth reading for. SLAA013's own illustration of the scale is the 8-bit case: "an error of 1/2 LSB for an 8-bit converter corresponds to 0.2 % FSR".
Where the static model stops being valid
- Worst-case summing is pessimistic. Offset, gain and INL are independent and rarely all at their limits with the same sign; the sum is a bound, not an expectation. A root-sum-square is the usual estimate, and a calibrated system removes the first two entirely.
- Static errors are DC errors. SLAA013 defines them as "those errors that affect the accuracy of the converter when it is converting static (dc) signals". At frequency the SINAD, ENOB, THD and SFDR of a datasheet's dynamic table take over — MT-003's definitions, and the ADC noise floor calculator's subject.
- The SNR is a quantization-only figure. 6.02n + 1.76 dB assumes an ideal converter and a full-scale sine; the reference's noise, the driver's noise and the clock's jitter all subtract from it, and no real 16-bit part reaches 98 dB.
- The aperture limit is one sine at full scale. It assumes the input reaches the rails and the error is judged at the zero crossing; a smaller or slower signal is easier. The formula also treats the uncertainty as a fixed window rather than a jitter spectrum.
- Nyquist is a floor, not a design. Twice the highest frequency is the theorem's limit; SLAA013's own filter chapter is about the anti-alias filter that a practical margin above it needs, because "the ideal filter is a so-called brickwall filter" and no real one is.
Common resolution mistakes
- Reading bits as accuracy. A 16-bit converter with 8 LSB of INL is a 13-bit measurement; the datasheet's INL and offset lines, not the title, say what is measured.
- Dividing by 2ⁿ. It is close, and for 12 bits and up the difference is below the errors; but SLAA013's definition is 2ⁿ − 1, and on an 8-bit part it is a 0.4 % difference in the LSB.
- Summing the DNL as well. It is already inside the INL. Its own limit is different: over 1 LSB, missing codes and non-monotonicity.
- Ignoring the clock. At 1 ns of aperture a 12-bit converter is only a 12-bit converter below 39 kHz; the "MSPS" on the box says nothing about that.
- Calibrating nothing. Offset and gain are three-quarters of the default budget and two calibration points remove them; the part is then INL-limited, which is usually a bit or two better.
Further reading
- The ADC noise floor calculator: where 6.02n + 1.76 dB comes from, SNR, ENOB and process gain for a real datasheet, and what the FFT floor is.
- The ADC charge-bucket calculator: the RC that lets a SAR input settle to the LSB.
- The op amp error budget calculator: the front end's offset and gain errors, in the same units.