An analog signal carries information as a continuous range of values. A digital signal carries information as discrete values, almost always two: and (off / on, low / high voltage).

A radio signal swinging continuously between, say, and is analog — every voltage in that range means something. The voltage on a wire inside a CPU is digital — it’s either close to ground or close to the supply, and anything in between is a transient the circuit is trying to escape from.

Digital is preferred for computation because a digital gate only has to distinguish “high” from “low,” not measure the exact voltage. That tolerates noise, manufacturing variation, and component aging in ways analog circuitry can’t. The basic element that implements a digital signal is a switch — a NMOS transistor or PMOS transistor turning a connection on or off.

Real-world signals are almost always analog at the source (a microphone’s voltage, a temperature sensor’s resistance, light intensity at a camera pixel). To process them digitally, you have to perform two discretizations:

  • Sampling — read the analog signal only at evenly spaced points in time, for sample rate . The Nyquist–Shannon theorem requires to be at least twice the highest frequency in the signal to recover it without aliasing.
  • Quantization — round each sample to one of a finite number of allowed levels (e.g., levels for a 16-bit ADC). The rounding introduces quantization noise, bounded by half the step size.

The hardware that performs both steps is an analog-to-digital converter (ADC); the reverse direction is handled by a digital-to-analog converter (DAC). (Each of these probably deserves its own note — sampling, quantization, ADC, DAC — but they aren’t in this vault yet.)