# Digital-to-analog converter A **digital-to-analog converter** (DAC) is an electronic system that turns a sequence of binary codes into an [[Analog_signal|analog signal]], usually a [[Voltage|voltage]] or an [[Electric_current|electric current]] proportional to each code. It is the inverse of the [[Analog-to-digital_converter|analog-to-digital converter]]: where that device samples and quantizes, this one rebuilds. Two operations are visible in every converter's output. Each code selects one of `2^N` levels, so the output is quantized in amplitude with a step of one least significant bit, and each level is held until the next code arrives, so the output is a staircase in time, the [[Zero-order_hold|zero-order hold]]. A [[Low-pass_filter|low-pass]] reconstruction filter then smooths the staircase into the waveform the codes describe. The two operations leave two signatures. Quantization leaves an error of at most half a step, which for a full-scale sine amounts to a signal-to-noise ratio of about `6.02*N + 1.76 dB`; the hold multiplies the spectrum by a sinc envelope that droops by about 3.9 dB at the [[Nyquist_frequency|Nyquist frequency]] and leaves images of the signal around every multiple of the sample rate for the filter to remove. Converters are built as binary-weighted or R–2R resistor networks, as thermometer-coded arrays of equal elements, as pulse-width modulators, and as [[Oversampling|oversampling]] [[Delta-sigma_modulation|delta-sigma]] modulators driving a one-bit output, and are judged by resolution, sample rate, monotonicity, distortion and dynamic range. They are found wherever numbers must become sound, pictures or radio waves, from [[Audio_signal_processing|audio]] players to video displays and transmitters. The page's primary microsim, *Digital-to-analog converter*, lets the reader set the bit depth, the number of samples per cycle and the amplitude of a sine, then watch the held staircase and the filtered output follow the target while a moving cursor takes the current code apart into its binary weights and a diagnostics panel reports the step size, the ideal signal-to-noise ratio and the sinc droop of the hold. ## Overview A converter of `N` bits accepts codes from `0` to `2^N − 1` and maps them onto a full-scale range, so its step, the least significant bit, is the range divided by `2^N`.[^dyer32] The microsim's Diagnostics panel prints this as `V_LSB = FSR/2^N` in units of the full-scale amplitude: 0.1250 at the default 4 bits, 0.0020 at 10. The step fixes the quantization error, which is at most half a step and, for a busy signal, behaves like noise with a root-mean-square value of `Q/√12`,[^dyer38] about 0.289 of one step;[^stiber59] the sketch measures the error of its own staircase and prints it beside that ideal value. For a full-scale sine the ratio of signal power to this noise power is `SQNR = 6.02*N + 1.76 dB`,[^dyer39] which the panel prints as 25.8 dB at 4 bits and 62.0 dB at 10. The hold is the second operation, and it belongs to the [[Sampling_(signal_processing)|sampling]] theory of the [[Nyquist–Shannon_sampling_theorem]]. Ideal reconstruction of a band-limited signal from its samples is the [[Whittaker–Shannon_interpolation_formula]], `x_r(t) = Σ_n x(nΔt)·sinc((t − nΔt)/Δt)`, a rectangular filter `Π(f/fs)` in frequency whose impulse response `fs·sinc(fs·t)` extends to both sides of every sample.[^tib116] Tiberius and Mulder note that it needs samples that have not yet arrived and is therefore unusable in real time.[^tib118] A converter instead holds each sample for one period: its impulse response is a rectangle of width `Δt` starting at the sample instant, and its frequency response is `H_r(f) = sinc(Δt·f)·exp(−jπfΔt)`, a sinc envelope with a delay of half a sample.[^tib119] The envelope is unity at zero frequency, `2/π` at the Nyquist frequency, which is the −3.92 dB the sketch prints as ZOH droop @ Nyquist, and zero at every multiple of `fs`; between those zeros it leaves spectral "scallops", images of the signal that the hold only partly suppresses even when the sampling theorem is satisfied.[^tib121] At the default 16 samples per cycle the sketch's signal sits at `f/fs = 1/16` and the droop there is −0.06 dB; at 3 samples per cycle it is −1.65 dB, and the staircase visibly stops resembling a sine, which is Tiberius and Mulder's own example of `2cos(2πt)` through a hold, block-like at 3 samples per second and "clearly a cosine" at 10.[^tib123] The reconstruction filter finishes the job. Dyer and Davis describe a converter's output as a stair-step followed by a low-pass filter with its corner at `fs/2`,[^dyer50] which removes the images and leaves the droop, itself small when the signal is well below the Nyquist frequency or corrected digitally beforehand. The sketch's reconstruction filter is a moving average about one sample period wide, an ILLUSTRATIVE stand-in for the analog filter that rounds off the treads without the steep cut-off a real filter has. The remaining ingredient is the mapping from bits to volts. Every level is a [[Binary_number|binary]]-weighted sum of the code's bits, the most significant bit worth half of full scale, the next a quarter and so on, and the sketch's ladder panel stacks those weights for the code under its cursor and prints their sum in LSB and the resulting `V_out` as a fraction of full scale. ## Applications ### Audio The audio converter is the low-frequency, high-resolution end of the field. Compact disc audio carries 16-bit words at 44.1 kHz,[^cd] a rate at which Downey's examples put 441 samples in a 10 ms segment,[^downey70] and Stiber, Stiber and Larson budget 107 dB of quantization headroom at 16 bits against 59 dB at 8, so that an 8-bit converter's noise is audible in quiet passages while a 16-bit one's is not.[^stiber60] Decoded [[MP3]] and other compressed streams, telephone [[Speech_coding|speech]] and synthesised sound all end in a converter feeding an amplifier and a [[Loudspeaker|loudspeaker]], and the converter's noise and distortion set the floor of the whole chain. The early compact disc players of the 1980s showed how the trade-offs are managed: rather than build a 16-bit converter with 16-bit linearity, one manufacturer's first players used a 14-bit converter run at four times the disc rate with digital noise shaping, which recovered the missing resolution in the audible band and pushed the images out to 176.4 kHz, where a gentle analog filter removed them.[^philips] The approach anticipated the oversampling delta-sigma converters that now dominate audio. ### Video Video converters sit at the other end of the trade-off: modest resolution, typically 8 to 10 bits, at rates of tens to hundreds of megahertz, since every pixel of every line needs a new code. A display driven by analog video uses three converters, one per colour, clocked at the pixel rate; in graphics adapters the converters were combined with a colour look-up table into a single RAMDAC that translated a palette index into three analog levels. The zero-order hold is visible here as the sharp edge between adjacent pixels, and the droop matters little because picture content rarely approaches the Nyquist frequency of the pixel clock. ### Digital potentiometer A digital potentiometer is a string of equal [[Resistor|resistors]] with switches that connect the wiper terminal to one tap; the code selects the tap, and the device presents a resistance, or a divider ratio, proportional to the code. It is a converter whose output is a resistance rather than a voltage, inherently monotonic because each higher code adds one more resistor, and it replaces the mechanical potentiometer in volume controls and calibration trims. ### Mechanical Any actuator that turns a binary word into a physical displacement is a mechanical converter. A stack of binary-weighted pistons or solenoids, each either extended or retracted, adds its strokes to a total travel proportional to the code, and a stepper motor driven by a counter turns a number into an angle in the same way. Such devices trade the speed of the electronic converter for force and are used where a position, not a voltage, is the wanted output. ### Communications In a transmitter the converter produces the modulated waveform from numbers: baseband in-phase and quadrature components that an analog mixer places on a [[Carrier_wave|carrier]], or, in a direct radio-frequency converter running at gigasamples per second, the carrier itself. The images at multiples of `fs` are the concern here, since an image falls in someone else's band, so the converter is followed by a sharp analog filter or preceded by a digital interpolation filter that raises the rate and moves the images far from the wanted signal. The same converters generate [[Radar]] waveforms and the excitation of [[Sonar]] arrays. ## Types The oldest architecture weights each bit with a resistor. In a binary-weighted converter the bit `k` drives a resistor of value `R/2^k` into a summing node, so that the currents add in the ratios 1, 2, 4, 8; the difficulty is that the resistors must span a ratio of `2^(N−1)` while matching to a fraction of the smallest step, which becomes impractical beyond about 8 bits. The R–2R ladder solves this with only two resistor values: each stage divides the contribution of the bit above it by exactly two, so a 16-bit ladder needs the same two values as a 4-bit one, and the output is `V_ref·D/2^N` for code `D`. The sketch's ladder panel shows the arithmetic both architectures perform, each set bit contributing `2^k` LSB to the sum. Switched current sources replace the resistors in fast converters, steering binary-weighted currents into the output rather than switching voltages. A thermometer-coded, or unary, converter uses `2^N − 1` equal elements and turns on as many as the code specifies. Every higher code adds one element, so the output cannot decrease as the code increases, and a mismatch between elements changes the step size but never the order; the cost is the element count, which doubles with every bit. Segmented converters combine the two, using thermometer coding for the few most significant bits and binary weighting for the rest. The pulse-width modulator is the simplest converter of all: a counter produces a rectangular wave whose duty cycle equals the code divided by `2^N`, and a low-pass filter recovers the average, a voltage proportional to the code. It is slow, since the filter must remove the switching frequency, but it needs only one output pin, and it is the converter behind most microcontroller "analog" outputs and motor drives. Oversampling converters go a step further. A digital [[Delta-sigma_modulation|delta-sigma modulator]] running at many times the sample rate turns the `N`-bit input into a stream of one-bit or few-bit codes whose quantization noise is shaped toward high frequencies; the analog part is then a trivially linear one-bit switch followed by a low-pass filter, and the [[Oversampling|oversampling]] ratio, not the matching of components, sets the resolution. A digital interpolation filter, often a [[Finite_impulse_response|finite impulse response]] design, raises the input rate first. Cyclic or algorithmic converters, the mirror image of the successive-approximation converter, process one bit per clock through a single halving stage, and hybrid designs mix all of the above. ## Performance A converter's static errors are those of its transfer curve. Offset shifts every level; gain error scales them; integral nonlinearity is the largest departure of any level from the straight line through the end points; and differential nonlinearity is the largest departure of any step from one LSB. A converter whose DNL never falls below −1 LSB is monotonic: a higher code always produces a higher output, a property control loops depend on, since a non-monotonic converter inside a feedback path can lock onto the wrong code. Binary-weighted converters risk their largest DNL at the major transition, where the most significant bit switches on and all the others switch off, and a mismatch there produces both a static step error and a dynamic glitch, a brief spike whose area is quoted as glitch energy. The dynamic errors belong to time and frequency. Settling time is how long the output takes to reach its new level within a fraction of an LSB; jitter in the update clock modulates the sample instants and adds noise that grows with signal frequency; and the sinc droop of the hold shapes the passband, small in the sketch's default setting at −0.06 dB but −3.92 dB at the Nyquist frequency, where it is corrected either by the reconstruction filter or by a digital pre-emphasis filter. The noise floor comes from the [[Johnson–Nyquist_noise|thermal noise]] of the resistors and switches, from the reference, and from the quantization itself, and the sketch's Diagnostics panel measures the last of these as the root-mean-square error of its own staircase in LSB. The measured value scatters around the ideal 0.289 rather than sitting on it, because the sketch has only a few dozen error samples at the default rate and its sine visits the same phases every cycle, not the busy input that the uniform-error model assumes.[^stiber59] Amplitude is a performance question too: a signal that does not fill the range wastes resolution, and one that exceeds it clips, which the sketch reports as CLIPPING in red once AMPLITUDE passes 100 percent, echoing Dyer and Davis's warning that clipping is worse than wasted resolution.[^dyer36] ## Figures of merit The figures by which a converter is chosen are the ones its data sheet leads with, and each corresponds to a row of the sketch's Diagnostics panel or to a control. | Figure of merit | What it fixes | In the sketch | |---|---|---| | Resolution, `N` bits | the step `FSR/2^N` and the ideal `SQNR = 6.02*N + 1.76 dB` | BIT DEPTH, 1–10 bits; V_LSB and ideal SQNR rows | | Maximum sampling rate | the Nyquist bandwidth `fs/2`, the image spacing and the sinc droop | SAMPLE RATE, 3–48 samples per cycle; the two ZOH droop rows | | Monotonicity | whether a higher code always gives a higher output | the ladder panel's weights, always summing upward | | Total harmonic distortion plus noise | the ratio of everything unwanted to the signal | measured RMS error row | | [[Dynamic_range]] | the ratio of the largest to the smallest reproducible signal, near the ideal SQNR for a perfect converter | full-scale usage row; CLIPPING above 100 percent | Resolution and rate trade against each other: the audio converter buys its 16 to 24 bits at tens of kilohertz, and the video or radio converter buys its hundreds of megahertz at 8 to 14 bits, with the oversampling converter converting a surplus of rate into bits. Total harmonic distortion plus noise, quoted in [[Decibel|decibels]] below the signal or as a percentage, folds the static nonlinearity and the noise floor into one number measured with a sine at the output; the effective number of bits inverts the ideal formula on that measurement, and a converter delivering 90 dB is behaving like a perfect 14.7-bit one. Dynamic range differs from signal-to-noise ratio in that it measures the smallest signal the converter can reproduce at all, so a converter whose small-signal linearity is poor has a dynamic range below its signal-to-noise ratio. ## Microsims The primary microsim, *Digital-to-analog converter*, is a three-panel scope. The top panel draws three cycles of the analog target sine, the DAC output (zero-order hold) as an amber staircase with a dot at each sample instant, and, when the reconstruction filter button reads ON, the green after reconstruction filter trace. Three sliders drive it: BIT DEPTH N from 1 to 10 bits, default 4; SAMPLE RATE fs/f from 3 to 48 samples per cycle, default 16; and AMPLITUDE from 10 to 115 percent of full scale, default 85. A red cursor sweeps the staircase and the lower-left panel, Binary-weighted sum of the code at the cursor, prints the code as `D / (2^N − 1)` and in binary, stacks a bar for each set bit from MSB to LSB, and totals them as Σ weights in LSB and `V_out` as a fraction of full scale. The Diagnostics panel lists resolution, output levels, V_LSB, samples per cycle, the ideal SQNR, the measured RMS error against the ideal 0.289 LSB, the ZOH droop at the signal frequency and at Nyquist, and full-scale usage. The model is ILLUSTRATIVE: the quantizer is mid-rise and ideal, the target is a pure sine, and the reconstruction filter is a moving average rather than a low-pass filter with a corner at `fs/2`. A three.js companion renders this concept in depth. *Try:* Set BIT DEPTH to 1 and step it up one bit at a time, watching V_LSB halve and the ideal SQNR climb from 7.8 dB to 62.0 dB at 10 bits while the staircase collapses onto the target; then drag SAMPLE RATE down to 3 samples per cycle and read ZOH droop @ signal fall to −1.65 dB as the treads widen into blocks, and finally push AMPLITUDE past 100 percent to see the full-scale usage row turn red with CLIPPING. ## Wikipedia : Wikitube **Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Digital-to-analog_converter) : [Wikitube](https://en.wikitube.io/wiki/Digital-to-analog_converter) Skeleton mirrored at revision 1373585195. Prose, emphasis and the microsims are Wikitube's own. ## See also - [[Audio_signal_processing]] - [[Delta-sigma_modulation]] - [[Zero-order_hold]] - [[Whittaker–Shannon_interpolation_formula]] - [[Analog-to-digital_converter]] - [[Quantization_(signal_processing)]] - [[Oversampling]] - [[Pulse-code_modulation]] - [[Nyquist–Shannon_sampling_theorem]] - [[PORTAL_Signal_Processing]] ## References Page numbers are PDF pages of the open editions. [^dyer32]: Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*. 1st ed., 2020, p. 32 (PDF page): 2^n codes and resolution = range/2^n. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods . CC BY-NC-SA. [^dyer36]: Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*. 1st ed., 2020, p. 36 (PDF page): clipping from too narrow a range is worse than wasted resolution. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods . CC BY-NC-SA. [^dyer38]: Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*. 1st ed., 2020, pp. 38-39 (PDF pages): the rms quantization noise Q/√12. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods . CC BY-NC-SA. [^dyer39]: Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*. 1st ed., 2020, pp. 39-40 (PDF pages): SNR = 6.02 N + 1.76 dB for a full-scale sine. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods . CC BY-NC-SA. [^dyer50]: Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*. 1st ed., 2020, pp. 50-51 (PDF pages): a DAC output is a stair-step followed by a low-pass filter at fs/2. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods . CC BY-NC-SA. [^stiber59]: Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain*. 2020, p. 59 (PDF page): σ = 1/√12 LSB ≈ 0.29 LSB, and the failure of the uniform error model for a slow or constant input. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain . CC BY-SA. [^stiber60]: Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain*. 2020, pp. 60-61 (PDF pages): quantization budgets of 59, 83 and 107 dB at 8, 12 and 16 bits and the quiet-passage budget. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain . CC BY-SA. [^tib116]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering - Theory*. 2026, pp. 116-119 (PDF pages): ideal reconstruction, H_r(f) = Π(f/fs), h_r(t) = fs·sinc(fs·t) and the interpolation sum. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib118]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering - Theory*. 2026, pp. 118-119 (PDF pages): the ideal reconstruction filter is non-causal and unusable in real time. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib119]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering - Theory*. 2026, pp. 119-122 (PDF pages): the zero-order hold, h_r(t) = (1/Δt)·Π((t − Δt/2)/Δt) and H_r(f) = sinc(Δt·f)·exp(−j2πfΔt/2). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib121]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering - Theory*. 2026, pp. 119-122 (PDF pages): the hold leaves spectral scallops at multiples of fs even when the sampling theorem holds. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib123]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering - Theory*. 2026, pp. 123-125 (PDF pages): Example 10.2, 2cos(2πt) through a zero-order hold is block-like at 3 Hz and clearly a cosine at 10 Hz. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^downey70]: Downey, A. *Think DSP: Digital Signal Processing in Python*. 2012, p. 70 (PDF page): a 0.01 s segment at 44.1 kHz holds 441 samples. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/think-dsp-digital-signal-processing-in-python . CC BY-NC. [^cd]: Citation needed: the 16-bit, 44.1 kHz format of compact disc audio is fixed by the Compact Disc Digital Audio standard (IEC 60908); a page reference to that standard, or to a Portal Book that states the format, would settle it. [^philips]: Citation needed: the 14-bit, four-times-oversampling converter with noise shaping in the first Philips compact disc players; the Compact Disc issue of the *Philips Technical Review* (vol. 40, 1982), which described the player's digital-to-analog conversion, would settle the figures and the date. ## Further reading - Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory* (2026). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory - Dyer, J.; Davis, C. *Measurement and Instrumentation: An Introduction to Concepts and Methods*, 1st ed. (2020). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/measurement-and-instrumentation-an-introduction-to-concepts-and-methods - Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain* (2020). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain ## External links - *Digital-to-analog converter*, the primary sketch: https://editor.p5js.org/sciencenibber/full/LPw0nh6BW (fork: https://editor.p5js.org/sciencenibber/sketches/LPw0nh6BW) <!-- Hubs: Signal_processing. Portals: PORTAL_Signal_Processing. Signal Processing portal wave 1 · 2026-09-17 · drafted. -->