Gives 16 different output levels.
Binary weighted resistor DAC and R‑2R ladder DAC, worked out side by side.
Aim
This page was made to go along with my written assignment on digital‑to‑analog converters. The assignment explains how the two circuits work; this page lets you actually try them — put in any digital number and it works out the analog voltage that comes out, step by step, for both types at once.
Everything runs inside your own browser. Nothing is sent anywhere and nothing is stored.
A DAC takes a number written in 0s and 1s and turns it into one steady voltage. Choose how many bits the converter has, the reference voltage it works from, and the resistor values. Then flip the switches to enter your digital number.
Gives 16 different output levels.
The fixed supply the switches connect to.
The smallest resistor in the circuit.
Sets how much the op‑amp magnifies.
Digital input — flip a switch up for 1, down for 0
Both circuits are given the same digital input, the same Vref and the same resistors, so you can see straight away how their outputs differ.
Type one
Output voltage
—Type two
Output voltage
—The minus sign appears because both circuits use the op‑amp in its inverting mode, so the output comes out on the negative side. Its size is what matters. Also notice that percentage resolution depends only on the number of bits: it is 6.6667 % for 4 bits, the same for both circuits.
Each bit that is a 1 pushes its own share of current into the op‑amp, and the output is just all those shares added up. A bit that is 0 contributes nothing, because its switch is connected to ground.
| Bit | Place value | State | Binary weighted | R‑2R ladder |
|---|
This is the real reason almost every converter you can buy uses the ladder. The binary weighted circuit needs a different resistor for every bit, each one twice the last, while the ladder manages with only two values no matter how many bits it has.
| Bit | Binary weighted needs | Its value | R‑2R needs | Its value |
|---|
If you feed in 0, then 1, then 2 and so on, the output does not rise smoothly. It climbs in equal jumps, one jump per step, which is why a DAC output is drawn as a staircase. Drag the sweep slider above and watch the marker move.
Both diagrams are drawn for 4 bits, with the switches set to 1010 as an example. In each one, a switch at 1 connects its resistor to Vref and a switch at 0 connects it to ground.
Both circuits end in the same place: an op‑amp wired as an inverting adder. The resistor Rf in the feedback path decides how many volts come out for each unit of current flowing in.
| Binary weighted | R‑2R ladder | |
|---|---|---|
| Resistor values needed | n different ones: R, 2R, 4R, 8R … | Only two: R and 2R |
| For an 8 bit converter | Largest resistor is 128 × R | Still just R and 2R |
| Making it accurately | Difficult, because very large and very small resistors must all be exact | Easy, because matching two equal resistors is simple |
| Number of parts | Fewer parts, easier to follow | About twice as many resistors, but all alike |
| Adding one more bit | Needs a brand new, doubled resistor value | Just add one more identical rung |
| Size of one step | Vref × (Rf/R) ÷ 2n−1 | Vref × (Rf/R) ÷ 2n |
| Where it is used | Teaching, and converters with very few bits | Almost every DAC chip made today |