I am trying to make a 4-bit R-2R D/A Converter where a +5V signal on D3 would output -5V, a +5V on D2 would output -2.5V, etc. How would the resistor values for R/2R be calculated?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
To a first approximation, the resistance R cancels out, however things are not so simple.
One factor that needs to be considered is the performance of the switches. If they are CMOS outputs they will have a substantial resistance, it will be different between switches, it will be different for "high" vs. "low" and the resistance will vary with temperature.
Take, for example, a CMOS buffer such as the CD4050. From the linked data sheet, we can see the output characteristics. Let's assume 10V (+/-5V operation).
The sourcing resistance is about 220 ohms, and the sinking resistance about 55 ohms maximum. It will increase by perhaps 40-50% at 125°C from the 25°C values in the graphs.
So, even if we reduce the 2R resistors by some average value of the switch resistance, there will be errors. If you want the error due to switch resistance to be much less than one LSB on your 4-bit DAC, you can calculate a minimum value for 2R. Say we choose something like 100K.
The maximum value of R will be limited by input bias current of your amplifier and noise, and also by parasitic capacitance if you expect the DAC to have good high frequency performance. For example, an amplifier with 200nA of input bias current and with R=100K would have an output voltage error of \$ 2 R \cdot 0.2\mu A\$ or 40mV.
That could be reduced in cases where the offset current is much less than the bias current by placing a matching resistor on the non-inverting input of \$ 2 \over 3 \$ \$ \cdot R \$ since the ladder has a constant impedance looking into the summing node of R.
It's pretty easy to achieve sub-LSB errors with a 4-bit DAC, but the difficulty increases rapidly as the number of bits increases.
The R and \$2\$R can be anything, it doesn't matter, and you usually want to choose them to be high value so as not to load the source too much. Often times the source input D\$0\$-D\$3\$ is buffered anyways.
If you see on the link I gave you (http://www.skillbank.co.uk/SignalConversion/dac.htm#r2r), there is a formula for Vout. Using that formula, if your feedback resistor Vf is also \$2\$R as you have drawn it, then Vout is not at all dependent on any particular value of R or \$2\$R.
However, the value you choose will add to the load on the power supply. That is why you will often want to choose a high-valued resistor, say \$100\$k and \$200\$k, to minimize the load on the power supply.
Also note that the output of an R-R\$2\$ ladder is always a fixed impedance R. This is the Thevinen equivalent impedance at the -ve input of the op-amp, and what the op-amp sees as it's source impedance. High source impedances to op-amp inputs cause increased thermal noise. Lower source impedances lower this thermal noise. So if you were going for a highly accurate \$16\$ bit R-\$2\$R ladder DAC, I would use lower valued resistors like \$10\$k or \$1\$k... for fewer numbers of bits the higher valued resistors will be fine. Lower valued resistors will increase current draw and thus power dissipation. This is the trade-off to make.