100nF

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.

quantization ±½0.50 LSB = 403 µVoffset1.00 LSB = 806 µVgain2.00 LSB = 1.61 mVINL1.00 LSB = 806 µVDNL (not summed)0.50 LSB = 403 µVtotal4.50 LSB = 3.63 mV0124error in LSB (1 LSB = 806 µV for 12 bits) — 8.8 bits are meaningful
Fig 1 — SLAA013's static error budget for this 12-bit converter: the ½ LSB of quantization that an ADC cannot avoid, the offset, gain and integral nonlinearity from the datasheet, and their worst-case sum of 4.5 LSB, 3.63 mV. DNL is shown but not summed — it is the step-size error whose limit is a missing code, and it appears in the INL. The total is worth 8.8 bits of the 12.
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

1 LSB=FSR2n−11\ \text{LSB} = \frac{FSR}{2^n - 1}
SLAA013 §2: the end steps are half width, so the range holds 2ⁿ − 1 full steps. Quantization error is ± ½ LSB.
Etotal=Eoffset+Egain+EINL+12 LSB (ADC)E_{total} = E_{offset} + E_{gain} + E_{INL} + \tfrac{1}{2}\ \text{LSB (ADC)}
§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.
nuseful=log⁡22n2 Etotaln_{useful} = \log_2\frac{2^n}{2\,E_{total}}
The bits left once the total error is one code's worth of uncertainty; equals n for an ideal ADC.
SNR=6.02n+1.76 dB,SNRworst=6.02n−4.24 dBSNR = 6.02n + 1.76\ \text{dB}, \qquad SNR_{worst} = 6.02n - 4.24\ \text{dB}
§5: quantization noise q²/12 against a full-scale sine, and the one-bit loss a ½ LSB DNL error (a missing code) causes.
fmax=1TA π 2n+1f_{max} = \frac{1}{T_A\,\pi\,2^{n+1}}
§4: the aperture uncertainty T_A must move a full-scale sine by less than ½ LSB at its zero crossing.
fs>2f1f_s > 2 f_1
§6: Nyquist. The anti-alias filter needs margin above it.

Assumptions

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.

ResolutionCodes1 LSB at 3.3 V1 LSB at 5 V1 LSB, % of FSRIdeal SNR
8-bit25612.9 mV19.6 mV0.39 %49.9 dB
10-bit1,0243.23 mV4.89 mV0.098 %62.0 dB
12-bit4,096806 µV1.22 mV0.024 %74.0 dB
14-bit16,384201 µV305 µV0.0061 %86.0 dB
16-bit65,53650.4 µV76.3 µV0.0015 %98.1 dB
18-bit262,14412.6 µV19.1 µV0.00038 %110.1 dB
20-bit1,048,5763.15 µV4.77 µV0.000095 %122.2 dB
24-bit16,777,216197 nV298 nV0.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

Common resolution mistakes

Further reading