Simple 3-bit DAC:
Imagine we were to set the input resistor values at multiple powers of two: R, 2R, and 4R of the comparator circuit of Figure (a). Beginning from V1 and going through V3, this would give each input voltage accurately half the effect on the output as the voltage before it. In other terms, input voltage V1 has a 1: 1 effect on the output voltage (gain of 1), whereas input voltage V2 has half that much effect on the output (a increase of 1/2), and V3 half of that (a gain of 1/4). These ratios are not arbitrarily selected: they are the same ratios corresponding to place weights in the binary number system. If we drive the inputs of this circuit with digital gates so that each of the input is either 0 volts or full supply voltage, the output voltage shall be an analog representation of the binary value of these three bits. If we desire to expand the resolution of this DAC (add more bits to the input), all we ought to do is add more input resistors, holding to the similar power-of-two sequence of values as in Figure (b).
(b)
Figure: (a) Simple 3-bit DAC; and (b) 6-bit Binary-weighted DAC