In a method and apparatus for compensating non-linearity of a gain of a
residual amplifier (RA), a pipelined analog-to-digital converter (ADC)
converts an analog input to a digital output (DO). The ADC includes a
plurality of pipelined stages (PPS). Each stage, which includes an
instance of the RA, provides a digital code corresponding to an output of
the RA included in a preceding stage. A memory stores a piecewise linear
representation for modeling the non-linearity of the gain. A calibrated
gain of the RA corresponding to each region of a plurality of linear
operating regions of the RA is stored in the memory. A gain adjuster
adjusts the digital code for each one of the PPS in accordance with a
gain factor derived from the calibrated gain for each one of the PPS. A
constructor constructs the DO from the adjusted digital code received
from each one of the PPS.