C1 · Lesson 23 · Ladders and DACs
The R-2R ladder, and turning a number into a voltage
Every time a phone plays sound or a microcontroller sets a motor's speed, a number becomes a voltage. The simplest circuit that does it is made only of resistors and switches: the R-2R ladder, which needs just two resistor values however many bits it has. It's a DC circuit you can analyze with the tools of this course, superposition and Thevenin, and it shows why precision matters: a small error in one resistor can make the output step backward when the number goes up.
- A 4-bit converter's output against its input code, 0 to 15. The dashed staircase is ideal: every step is one LSB, .
- The slider makes the most significant bit's weight a few percent wrong. Watch the step between codes 7 and 8.
- Below about −12.5%, code 8 gives less than code 7: the converter is no longer monotonic.
Predict
An 8-bit converter has a 5 V reference. How big is one step of the output?
About 19.5 mV. Eight bits give codes, so each step is mV, and the full-scale output (code 255) is V. Each extra bit halves the step.
Name it
Ladders from the far end
A ladder network alternates series and shunt elements. Work from the far end toward the input, combining as you go. In an R-2R ladder, every rung is a 2R resistor and every series link an R: at the last node, 2R ∥ 2R = R; add the series R to get 2R; in parallel with the next rung's 2R that's R again. Looking toward the far end from any node, the ladder is always R. That's why it divides cleanly by two at each step.
The R-2R converter
Each bit of an -bit code switches its 2R rung to (bit 1) or ground (bit 0). By superposition, bit alone contributes at the output, halving at each node it passes, so
for the code read as a binary number, with an output (Thevenin) resistance of R whatever the code. The LSB is , and the largest output is .
Binary-weighted converters
The obvious alternative uses resistors R, 2R, 4R, ... into a summing node. It needs a spread of in values: for 12 bits, from R to 2048R, all matched in ratio. The R-2R ladder needs only two values, which is why it's the one built on chips.
Accuracy
The most significant bit carries half the full scale, so its error matters most. If its weight is off by a fraction δ, the step from code to is off by LSBs. Keeping that within half an LSB needs : 0.024% for 12 bits, far tighter than ordinary resistors, which is why converters are trimmed or built from matched elements on one chip.
Worked example
An 8-bit R-2R converter with a 5 V reference gets the code 10100101. What does it output?
Show the solution
- Convert the code. 10100101 in binary is
- Output.
Answer the converter outputs 3.223 V.
Worked example
A 12-bit converter is built with binary-weighted resistors. What spread of values does it need, and how well must the MSB match?
Show the solution
- Spread of values. The resistors run from R to
- How well the MSB must match. For the mid-scale step to be within half an LSB, the MSB's weight must be right to
Answer the resistors span R to 2048R, and the MSB must be right to 0.024%.
Worked example
An 8-bit R-2R DAC with R = 10 kΩ and a 5 V reference drives a 100 kΩ load directly. What gain error does the load cause?
Show the solution
- The ladder's output. An R-2R ladder's output looks like the ideal voltage behind a resistance R, whatever the code.
- Divider with the load. The 100 kΩ load forms a divider with it: a 9.1% gain error, the same at every code.
- Full scale. comes out as 4.53 V.
- The fix. A buffer amplifier fixes it, which is why DAC chips either include one or specify a minimum load.
Answer the load causes a 9.1% gain error, so full scale drops from 4.98 V to 4.53 V.
Check
A 10-bit converter has a 2.5 V reference. How big is one LSB?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
Check
An 8-bit converter with a 3.3 V reference gets code 255. What does it output?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
What is the largest output of an 8-bit converter with a 1 V reference?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
An R-2R ladder uses R = 10 kΩ. What resistance do you see looking from any node toward the far end?
Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.
Check
A binary-weighted 10-bit converter's smallest resistor is R. How many times R is its largest?
Check
For a 12-bit converter, how precisely (in percent) must the MSB's weight be set for the mid-scale step to stay within half an LSB?
Check
A 10-bit R-2R DAC (R = 10 kΩ, 5 V reference) gets code 200 and drives a 1000 kΩ load.
(a)
What would it output unloaded?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
(b)
What does it output into the load?
Check
An N-bit converter with reference V gets code D.
Step 1
How big is one LSB?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What's its output?
Step 3
What's its full-scale output?
Explain why
Why does an R-2R converter need only two resistor values, while a binary-weighted one needs a different value for every bit?
In a binary-weighted converter, each bit's weight comes directly from its own resistor, so the weights 1, 2, 4, ... must be built as resistors R, 2R, 4R, ..., a different value per bit, up to thousands of times R. In an R-2R ladder, each node sees the same resistance R toward the far end, so every node halves whatever passes through it. The binary weights come from the structure of the ladder repeating the same halving, not from different resistor values, so two values, matched to each other, are enough for any number of bits.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.