Skip to main content

9. Digital to Analog Conversion

Learning Objectives

  • Explain what a DAC does and why digital systems need to interface with analog signals
  • Distinguish digital (discrete) signals from analog (continuous) signals
  • Explain how a binary-weighted resistor DAC converts a binary code to a voltage
  • Explain the R-2R ladder DAC and why it is preferred in practice
  • Describe resolution and its relationship to the number of input bits
  • Identify real-world applications where DACs are essential

Quick Answer

A digital-to-analog converter (DAC) takes a binary digital value and produces a corresponding continuous analog voltage or current. It matters because the real world — sound, light, motor speed, temperature — is fundamentally continuous (analog), while computers store and process everything as discrete binary numbers. A DAC is the bridge that lets digital systems actually control or produce analog outputs: without one, a digital music file could never become sound waves you hear through a speaker. The core idea is straightforward — each bit of the digital input contributes a specific, weighted amount to the final output voltage, and summing those contributions produces the analog result.

How Digital-to-Analog Conversion Works

Before looking at circuits, it helps to be precise about the two signal types being bridged. A digital signal is discrete: it only exists at defined levels (typically two, representing 0 and 1) and is expressed as binary numbers. An analog signal is continuous: it can take on any value within a range and varies smoothly over time, like the voltage from a microphone.

Binary-Weighted Resistor DAC

This is the conceptually simplest DAC architecture. Each bit of the digital input controls a switch connected to a resistor whose value is scaled by a power of 2 (R, 2R, 4R, 8R, ...), feeding into a summing amplifier. Because each resistor's contribution to the output current is inversely proportional to its resistance, the most significant bit (smallest resistor) contributes the most current, and the least significant bit (largest resistor) contributes the least — exactly matching binary place values.

Limitation: For high resolution (many bits), the resistor values must span a huge range (for an 8-bit DAC, from R to 128R), and manufacturing very precise resistors across that wide a range is difficult and expensive. This limits binary-weighted DACs to low-resolution applications.

R-2R Ladder DAC

The R-2R ladder solves the resistor-precision problem by using only two resistor values, R and 2R, arranged in a repeating ladder network. Despite needing only two distinct resistances, the ladder's structure still produces the correct binary-weighted current contribution for every bit — clever series/parallel resistor math (rather than needing dramatically different individual resistor sizes) does the weighting. This makes R-2R ladders far easier and cheaper to manufacture accurately at high resolutions, which is why they are the dominant DAC architecture in practice.

Delta-Sigma (Sigma-Delta) DAC

Instead of computing an analog voltage directly from binary weights, a delta-sigma DAC uses oversampling: it converts the input into a very fast stream of 1-bit pulses whose average density represents the desired analog value, then relies on a low-pass filter to smooth that pulse stream into a clean, high-resolution analog signal. This technique trades conversion speed for extremely high resolution (up to 24 bits) and is why delta-sigma DACs dominate high-fidelity digital audio.

Pulse Width Modulation (PWM) as a DAC

A microcontroller can approximate a DAC very cheaply using PWM: it outputs a digital square wave whose "on" duration (duty cycle) is proportional to the desired analog value, then a simple RC low-pass filter smooths the fast pulses into an average voltage. This is simple to implement purely in software/digital logic, but needs external filtering to produce a genuinely smooth analog output.

Resolution

Resolution describes how finely a DAC can divide its output range, and it's set directly by the number of input bits, n: an n-bit DAC produces 2ⁿ distinct output levels. An 8-bit DAC gives 256 possible output steps across its voltage range, while a 16-bit DAC gives 65,536 steps — far finer gradations, which is exactly why CD-quality audio uses 16-bit (or higher) DACs rather than 8-bit.

Real-World Example

Every time you play a digital music file, the audio DAC inside your phone or laptop reads a stream of binary samples (typically 44,100 or 48,000 per second, each 16 or 24 bits) and converts each one into a matching instantaneous voltage. Strung together and smoothed by a filter, those voltages recreate the continuous analog waveform that drives your speaker or headphones — this is literally how a string of 1s and 0s becomes music you can hear.

Common Misunderstanding

Students often think a DAC's output is a smooth, perfectly continuous curve straight out of the converter. In reality, the raw DAC output is a "staircase" of discrete voltage steps (one per sample), and it only looks smooth after passing through a low-pass reconstruction filter that rounds off the sharp steps between samples.

Key Terms

TermDefinitionRelated Concept
DACDigital-to-Analog Converter — converts binary values into continuous voltagesSignal conversion
Binary-weighted DACA DAC using resistors sized as powers of 2 per bitSimplicity, poor scalability
R-2R ladderA DAC using only two resistor values in a ladder network to achieve binary weightingPractical high-resolution DACs
Delta-sigma DACA DAC using oversampling and a 1-bit pulse stream, then filteringHigh resolution, audio applications
ResolutionThe number of distinct output levels a DAC can produce, equal to 2ⁿ for n bitsPrecision of conversion
Reconstruction filterA low-pass filter smoothing a DAC's stepped output into a continuous waveformOutput quality
Duty cycleThe proportion of time a PWM signal is "on" during one periodPWM-based DAC approximation

Common Mistakes

Misconception: A DAC's raw output is already a perfectly smooth analog waveform. Why it's wrong: The raw output changes in discrete voltage steps, one per input sample, producing a staircase shape rather than a smooth curve. Correct understanding: A low-pass reconstruction filter is needed after the DAC to smooth the stepped output into the continuous waveform we associate with "analog."

Misconception: More resolution (more bits) always makes a binary-weighted DAC easy to build accurately. Why it's wrong: Higher resolution requires a wider range of resistor values (spanning powers of 2), and manufacturing precisely matched resistors across that wide a range becomes very difficult and expensive as bit count grows. Correct understanding: For high-resolution designs, R-2R ladder architectures (using only two resistor values) are preferred specifically because they avoid this precision-scaling problem.

Misconception: PWM and DAC are two completely unrelated ways of producing analog-like output. Why it's wrong: A PWM signal followed by a low-pass filter is functionally acting as a (crude) DAC — the average voltage of the filtered PWM signal corresponds to a specific digital duty-cycle value, the same underlying "digital code to analog voltage" idea. Correct understanding: PWM-plus-filter is a legitimate, low-cost DAC technique, though generally lower in resolution and speed than dedicated resistor-ladder or delta-sigma DAC chips.

Comparison and Connections

DAC TypeResolutionSpeedComplexityTypical Use
Binary-weightedLow (≤8 bit practical)FastSimple concept, hard to scale preciselyEducational circuits, low-res control
R-2R ladderModerate to highFastOnly two resistor values, scales wellGeneral-purpose DACs
Delta-sigmaVery high (up to 24-bit)Slower (oversampled)Complex digital filteringHigh-fidelity audio
PWM + filterDepends on PWM resolutionSlow (filter settling time)Very simple, software-drivenMicrocontroller-based simple analog output

Practice Questions

Recall

  1. What does DAC stand for, and what does it convert? Digital-to-Analog Converter; it converts a discrete binary digital value into a continuous analog voltage (or current).

  2. How many distinct output levels does a 10-bit DAC provide? 2^10 = 1024 distinct levels.

Understanding

  1. Explain why the R-2R ladder is preferred over the simple binary-weighted resistor DAC for high-resolution designs. The binary-weighted DAC needs resistor values spanning a huge range (doubling for each bit), which is hard to manufacture precisely at high bit counts. The R-2R ladder achieves the same binary weighting using only two resistor values, making it far easier and cheaper to manufacture accurately at higher resolutions.

  2. Why does a delta-sigma DAC need a low-pass filter after its 1-bit pulse stream output? Because the pulse stream only represents the desired analog value as an average pulse density over time; the low-pass filter smooths out the rapid individual pulses, leaving behind the slower-varying average that corresponds to the actual analog signal.

Application

  1. A microcontroller with no built-in DAC needs to produce a variable analog voltage to dim an LED smoothly. What simple technique can approximate DAC behavior, and what extra component is needed? PWM output from a digital pin, combined with an external RC low-pass filter, which averages the fast on/off pulses into a smooth DC voltage proportional to the duty cycle.

  2. You are designing an 8-bit binary-weighted DAC and the MSB resistor is R = 1 kΩ. What resistor value is needed for the LSB (bit 0) of an 8-bit input? 128 × R = 128 kΩ, since each successive bit toward the LSB requires double the resistance of the bit before it, and there are 7 doublings from the MSB to the LSB in an 8-bit converter.

Analysis

  1. A student claims that increasing a DAC's resolution from 8 bits to 16 bits doubles its accuracy. Evaluate this claim. The claim understates the improvement — going from 8 to 16 bits increases the number of distinct output levels from 256 to 65,536, a 256-fold increase (2^8), not merely double, because each added bit doubles the number of representable levels.

  2. Compare a binary-weighted DAC and a delta-sigma DAC for a high-fidelity audio application requiring very smooth, high-resolution sound reproduction. Which is more suitable and why? A delta-sigma DAC is far more suitable, because it can achieve very high effective resolution (up to 24-bit) through oversampling and noise shaping, whereas a binary-weighted DAC becomes impractical to manufacture precisely beyond roughly 8 bits, making it unsuitable for the resolution demands of quality audio.

FAQ

Why can't computers just output analog signals directly without a DAC? Because digital logic circuits only produce and process discrete voltage levels (0 and 1 states); there is no native mechanism inside purely digital logic for producing a continuously varying voltage, so a dedicated conversion circuit (the DAC) is required to bridge to the analog domain.

What is the "staircase effect" in DAC output, and does it matter? It refers to the DAC output changing in discrete steps rather than smoothly, since it can only output one of 2ⁿ specific voltage levels at a time. It matters because without filtering, those steps introduce unwanted high-frequency components into the signal — a reconstruction filter removes them, restoring a smooth waveform.

Is a higher-resolution DAC always better? Not necessarily for every application — higher resolution generally means more circuit complexity, higher cost, and sometimes slower conversion speed (as with delta-sigma designs). The right resolution depends on how precisely the application actually needs to represent its analog values.

How is DAC resolution related to the number of bits? Resolution equals 2ⁿ distinct levels for an n-bit DAC. Adding one more bit always doubles the number of achievable output levels, which is why resolution improvements accelerate quickly as bit count increases.

Where do I encounter DACs in everyday devices? Audio playback devices (phones, computers, music players), video display electronics, motor speed controllers, and any device with an analog output jack or dial controlled by digital electronics — anywhere a digital system needs to produce a real-world continuous signal.

Quick Revision

  • A DAC converts a discrete binary digital value into a continuous analog voltage or current
  • Digital signals are discrete (0/1 states); analog signals vary continuously
  • Binary-weighted DACs use resistors scaled by powers of 2 per bit; simple but hard to scale precisely
  • R-2R ladder DACs use only two resistor values, making high resolution practical and accurate
  • Delta-sigma DACs use oversampling and a 1-bit pulse stream plus filtering for very high resolution
  • PWM plus a low-pass filter is a simple, low-cost way to approximate DAC behavior
  • Resolution = 2ⁿ output levels for an n-bit DAC; each added bit doubles the achievable levels
  • Raw DAC output is a stepped "staircase"; a reconstruction filter smooths it into a continuous waveform

Prerequisites: Binary number system, basic op-amp summing circuits, resolution and quantization concepts

Related Topics: Analog-to-digital conversion, memory devices, audio signal processing

Next Topics: Analog-to-digital conversion (the reverse process)