Skip to content
View in the app

A better way to browse. Learn more.

TEST SITE

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Digital to Analog Conversion

The digital-to-analog converter (DAC) does the reverse of the ADC: it takes a binary number and produces a corresponding analog voltage. Every time a phone, a computer or a streaming player plays audio through headphones, a DAC converts the stream of digital samples back into an analog signal. DACs also generate the waveforms of signal generators, set reference voltages, control motor speeds and calibrate circuits.

What you will learn: Binary-weighted DAC, R-2R ladder DAC, output voltage calculation, resolution and accuracy, settling time, glitches, DAC reconstruction filtering, and DAC applications.
R-2R ladder DAC circuit schematic for a 4-bit DAC, showing R and 2R resistors, binary switches, reference voltage, and output voltage calculation

A 4-bit R-2R ladder DAC. Only two resistor values (R and 2R) are needed regardless of bit count. Each binary input switches its 2R resistor between Vref and ground.

View Larger

The DAC Concept

A DAC takes an N-bit binary input code and produces an analog output voltage proportional to that code. The output voltage ranges from 0 V (or −Vref for bipolar designs) when the input code is all zeros, to Vref (or +Vref) when the input code is all ones.

The relationship is linear: if the input code doubles, so does the output voltage. The step size is the same as the ADC: Vref / 2N. An N-bit DAC with reference voltage Vref produces one of 2N possible output voltages, each separated by one step size.

DAC output voltage formula:

Vout = (D / 2N) × Vref

Where D is the decimal value of the binary input code, N is the bit depth, and Vref is the full-scale reference voltage.

Binary-Weighted DAC

The simplest DAC concept is the binary-weighted (or weighted resistor) DAC. Each bit in the binary input controls a switch that connects a resistor to a summing amplifier. The resistors are weighted so that each one contributes a current proportional to the bit's binary weight: the LSB resistor is the largest (contributing the least current), and the MSB resistor is the smallest (contributing the most).

For a 4-bit binary-weighted DAC with Vref = 5 V and a base resistor of R:

  • Bit 3 (MSB, weight 8): resistor = R → current contribution = Vref/R
  • Bit 2 (weight 4): resistor = 2R
  • Bit 1 (weight 2): resistor = 4R
  • Bit 0 (LSB, weight 1): resistor = 8R → smallest current contribution

The problem with binary-weighted DACs is that they require a wide range of precisely matched resistors. For a 12-bit DAC, the MSB resistor and LSB resistor must differ by a factor of 2,048. Manufacturing resistors to high accuracy across such a wide range is impractical, so binary-weighted DACs are only used for low-resolution applications (4–6 bits). The R-2R ladder solves this problem.

The R-2R Ladder DAC

The R-2R ladder is an elegant solution that requires only two resistor values — R and 2R — regardless of the number of bits. The circuit forms a ladder-shaped network: 2R resistors connect each bit's switch node to the ladder, and R resistors connect the nodes horizontally in series.

The clever property of the R-2R ladder is that looking into any node of the ladder, the Thevenin equivalent resistance is always exactly R. This means each bit's 2R switch resistor sees the same load, and the contribution of each bit is proportional to its binary weight, just like a binary-weighted DAC but using only 2R and R values. You can extend the ladder to any number of bits simply by adding another R-2R rung at the LSB end.

Because only two resistor values are needed, they can be matched to high precision on a single integrated circuit substrate. This is why virtually every precision DAC chip — from the PCM5102 audio DAC in a Raspberry Pi to the AD9744 high-speed DAC in a signal generator — uses an R-2R ladder internally.

Calculating DAC Output Voltage

Example: 8-bit DAC with Vref = 5 V, input code = 10101010 binary (170 decimal)

Vout = (170 / 256) × 5 V = 0.664 × 5 V = 3.32 V

Step size = 5 / 256 = 19.5 mV per step

The output voltage for code 170 is 3.32 V.

Example: 12-bit audio DAC, Vref = 3.3 V, input code = 2048 (midscale)

Vout = (2048 / 4096) × 3.3 V = 0.5 × 3.3 V = 1.65 V

Step size = 3.3 / 4096 = 0.806 mV per step

A 12-bit DAC with 3.3 V reference produces steps of about 0.8 mV — fine enough for high-quality audio.

Settling Time and Glitches

When the input code changes, the DAC output does not instantly jump to the new voltage. The output takes a finite time to settle to within a specified accuracy of the final value. This is called the settling time. Typical DAC settling times range from a few nanoseconds for fast video DACs to several microseconds for precision audio DACs. For audio applications, settling time is rarely a problem because the output is sampled at audio frequencies (44 kHz) and the DAC is fast enough to settle between samples. For RF DACs operating at hundreds of MSPS, settling time directly limits the output frequency.

Glitches are brief voltage spikes that occur as the input code transitions. The worst glitch happens at the code midpoint (0111...1 to 1000...0), where many bits change simultaneously. Because the bits do not all switch at exactly the same instant, there is a brief moment when the code is neither the old value nor the new value — this produces a transient spike at the output. Glitch energy is measured in nV·s (nanovolt-seconds). Glitch energy is important in audio DACs because glitches create distortion and intermodulation products. Modern IC DACs include deglitching circuits (sample-and-hold stages between the DAC core and output) to minimize this problem.

Reconstruction Filtering

A DAC's output is inherently a staircase waveform — it holds each value until the next code is loaded. This staircase shape contains the desired signal plus high-frequency image components at multiples of the sample rate. A low-pass filter at the DAC output — called the reconstruction filter or anti-imaging filter — removes these high-frequency images and smooths the staircase into a clean continuous waveform.

Without a reconstruction filter, the high-frequency images would appear in the output spectrum. This is the output-side equivalent of the aliasing problem in ADCs. The reconstruction filter in an audio DAC typically rolls off steeply above 20 kHz (for audio at 44.1 kHz sample rate). In high-speed signal generators, the reconstruction filter must pass the desired signal band while rejecting images at sample_rate ± signal_frequency.

DACs in Practice

Audio output. Phones, computers, music players and audio interfaces use 16- to 32-bit delta-sigma audio DACs. After the digital processing (volume, equalization, decoding), the samples are converted to an analog signal and filtered to remove the sampling images before reaching the headphone or line amplifier.

Waveform generation. Function and arbitrary waveform generators, and DDS chips such as the AD9833, use fast DACs to produce their output waveforms from a table of samples. The DAC's sample rate and the reconstruction filter after it set the highest clean output frequency.

Control voltages. Slower DACs set analog control voltages: the threshold of a comparator, the bias of an amplifier, the speed of a motor driver, the brightness of an analog-dimmed LED driver, or the offset that calibrates a sensor. Many microcontrollers include a 10- or 12-bit DAC for this.

PWM as a cheap DAC. Where no DAC is available, a PWM output followed by an RC low-pass filter produces a DC voltage proportional to the duty cycle — slower and noisier than a true DAC, but adequate for many control tasks.

Frequently Asked Questions

Why do some DACs have poor sound at low volume levels?

At low volume levels the audio signal uses only the lower-order bits of the DAC. Imperfections in those lower bits — non-linearity, noise, unequal step sizes — become more audible relative to the signal level. High-quality audio DACs maintain linearity down to very low bit levels through careful design and calibration. Applying a small amount of random noise (dither) before the DAC can actually improve perceived audio quality at low levels by decorrelating the quantization error from the signal — this is why many recording engineers apply dither before saving a 16-bit audio file.

What is the difference between a DAC and a PWM output?

A true DAC produces a direct voltage proportional to the digital code. A PWM (Pulse Width Modulation) output rapidly switches between 0 V and Vref with a duty cycle proportional to the desired output value. After low-pass filtering the PWM output, you get an average DC voltage that approximates the DAC function. PWM DACs are cheap (any microcontroller can generate PWM) but have limited bandwidth and substantial ripple. They are used for LED brightness control and coarse analog output, not for audio or RF signal generation.

Test Your Knowledge

Answer the questions below to check your understanding of this lesson. Every answer can be found in the lesson above.

Loading questions...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.