C123 of 30
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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, Vref/16.
  • 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?

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 N-bit code switches its 2R rung to Vref (bit 1) or ground (bit 0). By superposition, bit k alone contributes Vref/2N−k at the output, halving at each node it passes, so

Vout=VrefD2N

for the code D read as a binary number, with an output (Thevenin) resistance of R whatever the code. The LSB is Vref/2N, and the largest output is Vref(1−2−N).

Binary-weighted converters

The obvious alternative uses resistors R, 2R, 4R, ... into a summing node. It needs a spread of 2N−1 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 2N−1−1 to 2N−1 is off by 2N−1δ LSBs. Keeping that within half an LSB needs |δ|≤2−N: 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
  1. Convert the code. 10100101 in binary is 128+32+4+1=165
  2. Output. Vout=5×165256=3.223V

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
  1. Spread of values. The resistors run from R to 211R=2048R
  2. 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 2−12=0.024%

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
  1. The ladder's output. An R-2R ladder's output looks like the ideal voltage behind a resistance R, whatever the code.
  2. Divider with the load. The 100 kΩ load forms a divider with it: 100100+10=0.909 a 9.1% gain error, the same at every code.
  3. Full scale. 5×255256=4.98V comes out as 4.53 V.
  4. 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°.

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?

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.