An integrated circuit comprises a gain stage circuit coupled to a
compensation circuit. Both the gain stage circuit and the compensation
circuit respectively comprise a first current source and a second current
source that are subject to the same process variations. A negative
feedback circuit is used to generate a corrective current in relation to
the second current source, indicative of a current that needs to flow
through a load in addition to a current flowing through the second
current source in order for a variable voltage to be substantially equal
to a reference voltage used to drive the first and second current
sources. A compensating current corresponding to the corrective current
generated for the second current source is applied to the first current
source to compensate for process variation in the gain stage circuit in
respect to the first current source.