A converter comprises an input terminal to receive a first analog signal,
a digital-to-analog converter to provide second analog signals related to
digital values applied to the digital-to-analog converter. A comparator
is coupled to receive the first and second analog signals, the comparator
also comprising a variable-gain amplifier to provide an output signal
based on a difference between the first and second analog signals. A
state machine receives the output signal of the comparator and to
generate the digital values applied to the digital-to-analog converter
based on the output signal of the comparator and a controller sets the
gain of the variable-gain amplifier selectively.