A regulator is provided. The regulator includes a main switch, a
synchronous switch, an inductor, a sample-and-hold circuit, a ramp
generator, a PWM comparator, an error amplifier, and a current sense
amplifier. A current through the synchronous switch is sensed by the
current sense amplifier. Also, a current sense voltage provided by the
current sense amplifier is sampled when the synchronous switch is on, and
held when the synchronous switch is off. The ramp generator is arranged
to generate a voltage ramp that emulates the slope of the inductor
current while the synchronous switch is open. Additionally, the sampled
synchronous switch current is combined with the voltage ramp. The PWM
comparator is arranged to provide a PWM signal by comparing the voltage
ramp to a comparison signal provided by the error amplifier.