An apparatus includes a
clock generator configured to generate a set
signal fed into a set input of a latch, an
error amplifier configured to generate a COMP
signal, an offset generator configured to generate different offset voltages, and a
comparator configured to generate a reset
signal fed into a reset input of the latch, wherein a non-inverting input of the
comparator is configured to receive a signal equal to a sum of a current sense signal and a slope compensation signal, and wherein the current sense signal is equal to a current flowing through a power converter times an adjustable
gain, and an inverting input of the
comparator is configured to receive an
error signal, and wherein the
error signal is equal to the COMP signal minus an offset
voltage generated by the offset generator.