Elsia All Lessons

Digital Electronics

ADC and DAC

The real world is analog (continuous voltage), while processors are digital (discrete numbers). The ADC (Analog-to-Digital Converter) is one direction of the bridge: it turns voltage into a number. The DAC is the reverse: it turns a number back into voltage. An ADC works in two steps: sampling (grab time discretely) and quantization (round the amplitude to the nearest step). Recording a microphone is an ADC job; playing it through a speaker is a DAC job.

Resolution is set by the number of bits: an n-bit ADC divides the range into 2ⁿ steps. 8-bit → 256, 10-bit → 1024, 12-bit → 4096 levels. The smallest step (LSB) is the reference voltage divided by the number of steps: LSB = Vref / 2ⁿ. For example, Vref=5 V, 10-bit → LSB = 5/1024 ≈ 4.9 mV; the ADC cannot see changes smaller than this. This unavoidable rounding error is called quantization noise (≈ ±½ LSB).

The sampling rate has a lower bound: the Nyquist theorem says that to capture a signal correctly you must sample at at least twice its highest frequency (fs > 2·fmax). Sample more slowly and high frequencies appear as low ones — this is called aliasing (like a spinning wheel appearing to turn backward on camera). That is why an anti-aliasing (low-pass) filter is always placed at the ADC input. Audio CDs sample at 44.1 kHz because the ear hears up to ~20 kHz.

Formulas

Number of levels = 2ⁿ
LSB = Vref / 2ⁿ
Quantization noise ≈ ±½ LSB
Nyquist: fs > 2·fmax

⚡ Open this lesson in the simulator — free

Test Yourself

Into how many distinct levels does a 12-bit ADC divide the input range?
Answer: 4096 — 2¹² = 4096 levels.
For Vref = 3.3 V and an 8-bit ADC, what is the approximate LSB (smallest step)?
Answer: 12.9 mV — LSB = 3.3 / 2⁸ = 3.3/256 ≈ 12.9 mV.