A re-configurable circuit acts as an Analog-to-Digital Converter (ADC) and
as a digital-to-analog converter (DAC). An array of binary-weighted
capacitors stores an analog input. Switches connect different capacitors
in the array to fixed voltages that cause charge-sharing with a terminal
capacitor. The voltage of the terminal capacitor is compared by a
re-configurable comparator stage for each different combination of the
capacitors. The comparison results are analyzed to determine the closest
digital value for the analog input. In DAC mode, the array capacitors are
switched based on an input digital value. The switched capacitors connect
to a charge-sharing line to generate an analog voltage that is applied to
the re-configurable comparator stage. A differential amplifier generates
a buffered analog voltage that is fed back to the other input of the
re-configurable comparator stage for unity gain. The gain of the
re-configurable comparator stage adjusts for ADC and DAC modes.