Math Bridge: ADC Codes and Aliases

← Back to Analog-Digital Worked Examples
Math BridgeElectronicsStruggle-friendly runway

What does a 10-bit ADC actually report for 1.65 V?

Follow one voltage through bin width, integer code, reconstruction, noise, and sampling.

Eddie, the electronics guideEddie guides
The one targetConvert an input voltage into a code and back without mixing scales.
The chapter case10 bits, 3.3 V reference, 1.65 V input, 8 kHz sampling, 20 kHz tone.
What it buys youA bounded code estimate plus the separate time-domain alias check.

A technician must decide whether reported ten-bit code is safe before changing adc input voltage on the real device. The result is unresolved until the rule and units are checked. Predict the direction first.

See the relationship before changing it

The figure reads from left to right. The blue card is adc input voltage. The middle card applies this page's rule. The green card is reported ten-bit code. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only adc input voltage, so the numeric fixture does not switch without explanation.

ADC input voltage changes reported ten-bit code An input card leads through the rule code = floor((input / 3.3 V) x (2^10 - 1)) to the reported ten-bit code result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. The converter reports an integer code rather than a continuous voltage.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 1.65 V.

  2. 2

    Name the relationship. code = floor((input / 3.3 V) x (2^10 - 1))

  3. 3

    Substitute with units. floor((1.65 / 3.3) x 1,023) = 511 counts

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change adc input voltage

Try Predict the direction of code = floor((input / 3.3 V) x (2^10 - 1)). Test another adc input voltage, then compare reported ten-bit code.

1.65 V
Chapter baseline
Reported ten-bit code

Observe The converter reports an integer code rather than a continuous voltage. Reset adc input voltage to 1.65 and compare reported ten-bit code.

Explain The converter reports an integer code rather than a continuous voltage.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only adc input voltage moves here. Field effects named in the technical boundary stay fixed.

1. Start with the physical story

An ADC freezes voltage at one instant and assigns it to one integer bin. More bits make narrower bins, but the result is still rounded. Sampling adds a second grid in time, so fast tones may fold into the kept band.

Eddie: Voltage resolution and sample rate are different axes; both can lose information.

2. Name every algebra move

1

Count bins2¹⁰=1024 bins and endpoint codes 0–1023.

2

Find bin widthq=Vref/1024.

3

Choose the integer codeFloor (Vin/Vref)×1023.

4

Reconstruct voltageMultiply D/1023 by Vref.

5

Check limitsUse 6.02N+1.76 for ideal SNR and fs/2 plus folding for time.

3. Reproduce the chapter case

q=3.3/1024=3.2227 mV
D=floor[(1.65/3.3)1023]=511
Vest=3.3(511/1023)=1.64839 V
error=−1.613 mV; SNRideal=62.0 dB
fN=8/2=4 kHz; |20−2(8)|=4 kHz

The endpoint formula maps exactly 3.3 V to code 1023, while q uses 1024 equal bins. Keeping those roles separate avoids an off-by-one error.

4. Try one real input

TryMove input voltage and predict the integer code and reconstructed voltage.

Input voltage
Bin width
Half-LSB bound
Reported code
Reconstructed voltage
Reconstruction error
Ideal SNR
Nyquist
20 kHz alias

ObserveThe code changes in steps rather than continuously. SNR and alias stay fixed because bit depth and sample rate did not move.

ExplainThe integer code is an amplitude decision. The 20 kHz fold is a time-sampling decision made before software sees that code stream.

Technical boundaries.

This uses ideal endpoint scaling, a stable 3.3 V reference, and an ideal full-scale sine SNR model.

ADC
Offset, gain, INL, DNL, aperture jitter, input settling, and clipping add error.
Reference
Noise, tolerance, drift, loading, and grounding move every code boundary.
Signal
An analogue filter must attenuate unwanted energy before sampling; digital cleanup cannot undo folding.

Correct, not complete: this ledger does not certify an ADC channel or anti-alias design.

5. Use the result in the design

Match reference and bit depth to the sensor span, check source settling and reference error, then choose a sample rate and analogue filter from the signal bandwidth.

6. Record the evidence state

Record converter and mode, reference and measurement, input range and source impedance, code rule, sample rate, filter response, raw codes, reconstructed units, and calibration residuals.

7. Check yourself

Why are there 1024 bins but maximum code 1023?
Answer: Ten bits encode 1024 distinct integers beginning at zero, so the last label is 1023.
Why reconstruct with 1023 here?
Answer: The chapter uses endpoint scaling so code 1023 maps to the 3.3 V reference exactly.
Can software remove the 20 kHz tone after it folds to 4 kHz?
Answer: It can remove 4 kHz energy, but it cannot prove whether that evidence came from 4, 12, or 20 kHz after folding.
Honesty boundary.

The arithmetic reproduces the chapter's 10-bit, 3.3 V, 1.65 V case and its 8 kHz/20 kHz alias example.

ADC
Offset, gain, INL, DNL, aperture jitter, input settling, and clipping add error.
Reference
Noise, tolerance, drift, loading, and grounding move every code boundary.
Signal
An analogue filter must attenuate unwanted energy before sampling; digital cleanup cannot undo folding.

Correct, not complete: this ledger does not certify an ADC channel or anti-alias design.