A Simple 4-bit digital-to-analog converter that is constructed from a digitally controlled switch (74HC4066), a set of Binary-Weighted resistors, and an operational amplifier. The basic idea is to create an inverting amplifier circuit whose gain is controlled by changing the input resistance Rin. The 74HC4066 and the resistors together act as a digitally controlled Rin that can take on one of 16 possible values. (You can think of the 74HC4066 and resistor combination as a digitally controlled current source.