Steve Hardy wrote: > Now a question for you gurus: given that each of 4 outputs can be in > one of 3 possible states, one could conjecture that it is possible to > make a DAC with 3^4 = 729 possible output levels. Is this possible in 81 > practice? Ignore the imperfections of the outputs - assume they are > exactly 0V or 5V or infinite impedance, and your resistors and opamp > are perfect. Is it possible to make a linear (not just monotonic) > DAC? Consider the op-amp circuit shown below: +5V ^ \ I0 Rf 2R0 / ---> +------/\/\/\----+ R0 \ R0 | |\ | P0 --/\/\/\---+--/\/\/\--+-----+---|-\ | | | \ | | | \ | | |U1 /--------+--- Vout +5V | | / ^ | 0V --|+/ \ I1 | |/ 2R1 / ---> | R1 \ R1 | P1 --/\/\/\---+--/\/\/\---+ | +5V | ^ | \ | 2R2 / I2 | \ ---> | R2 | R2 | P2 --/\/\/\---+--/\/\/\---+ | +5V | ^ | \ | 2R3 / I3 | \ ---> | R3 | R3 | P3 --/\/\/\---+--/\/\/\---+ This circuit has an output voltage equal to: Vout = - (I0 + I1 + I2 + I3)*Rf Where Ix = Ix = 1*5V/(8Rx) when Px=0V = 2*5V/(8Rx) when Px=open circuit = 3*5V/(8Rx) when Px=5V Suppose we pick Rf = R3 = 3R2 = 9R1 = 27R0. Then the output voltage is Vout = -5/8*((1/3^3)*S0 + 1/(3^2)*S1 + (1/3^1)*S2 + 1*S3) Where Si = 1,2,3 for Px = 0,open,5 Here's a little table illustrating the first few values: P0 P1 P2 P3 Vout --------------------------------- 0 0 0 0 -0.9259 open 0 0 0 -0.9491 5 0 0 0 -0.9722 0 open 0 0 -0.9954 open open 0 0 -1.0185 5 open 0 0 -1.0417 etc 5 5 5 5 -2.7778 The annoying -0.9259V offset voltage is easily removable. But the series is linear and monotonic, each step being -23.15mV. Perhaps someone else would be kind enough to check the arithmetic... Scott