A power supply generates a supply voltage that varies from a first voltage level to a second voltage level. A first current source is coupled to the power supply and generates a current that varies due to channel-length modulation. A channel-length modulation (CLM) compensation mechanism is provided to reduce the current variation of the first current source by compensating the channel-length modulation (CLM) of the first current source.