A four-bit R–2R DAC
Turn four bits into a voltage
DAC means Digital to Analog Converter: it turns a number into a voltage. An R–2R ladder combines resistors of resistance R and twice R. A bit is 0 or 1. LSB (Least Significant Bit) has weight 1; MSB (Most Significant Bit) has weight 8 here. Four bits select 16 voltage levels.
EXPERIMENT BENCH
Change the circuit settings, predict the readings, then check a challenge. These are learning models, with the assumptions explained in each lesson.
Sign in to save progress. Guest progress stays on this device.
How it works
Ideal four-bit voltage ladder with a buffer, a circuit that follows voltage without loading the ladder. The output is unloaded. Reference Vref is 1–5 V. Resistor errors, switch glitches, settling time and output-current limits are omitted.
b0 to b3 are input bits with weights 1, 2, 4 and 8. Code is their weighted sum. Vout is output voltage; Vref is reference voltage. One LSB step is Vref/16. Code 15 is one step below Vref, not equal to it.
Difficulty
Build · Observe
Power on at Vref = 5 V. Set only b3 = 1, code 8, to obtain 2.5 V.
Need a hint?
Vref=5 V; b3=1; b2=b1=b0=0 → 2.5 V
Explore · Experiment
Keep Vref = 5 V. Set b2 = b0 = 1 and the other bits to 0, code 5, for 1.5625 V.
Need a hint?
Vref=5 V; b2=b0=1; b3=b1=0 → 1.5625 V
Solve it · Solve
At Vref = 5 V set all four bits to 1, code 15. Reach 4.6875 V and explain the missing last step.
Need a hint?
Vref=5 V; b3=b2=b1=b0=1 → 4.6875 V
Extra reading and circuit recipes
A four-bit R–2R DAC
A digital controller stores numbers, while an analog circuit responds to voltage. A resistor ladder is a bridge between them: switches choose fractions of a reference and the output adds those fractions.
code = b0 + 2b1 + 4b2 + 8b3; Vout = Vref × code/16; ΔV = Vref/16
At 5 V, one step is 0.3125 V. The highest code is 15 steps, or 4.6875 V. This small staircase has no values between its steps unless another circuit changes the output.
A useful connection
The ladder needs only two resistor values. Accurate ratios matter more than choosing a magical absolute resistance.
A surprising detail
Adding a bit doubles the number of codes and halves the ideal voltage step at the same reference.
A useful trap to avoid
Sixteen codes run from 0 to 15. Dividing by 15 would make this model’s transfer equation wrong.
At code 8, Vref changes from 5 V to 2 V. Vout becomes…
- 1 V
- 2 V
- 2.5 V
Read more
Code 8 selects half the reference: 2 × 8/16 = 1 V.
Half the reference
Use only the most significant bit.
Code 8 produces 2.5 V at a 5 V reference.
A tiny first step
Use only the least significant bit.
Code 1 produces 0.3125 V at a 5 V reference.
Try another change
Compare code 7 (0111) with code 8 (1000). Many bits change, but the ideal voltage rises by only one step. Real switches can briefly produce a glitch, which this model omits.