A PWM controller for a voltage regulator comprises an error amplifier to
generate an error signal from a difference between the output voltage of
the voltage regulator and a reference voltage, and a comparator to
compare the error signal with a ramp signal to generate a PWM signal to
switch the pair of high side and low side switches of the voltage
regulator to produce the output voltage and an output current. When the
output current is greater than a threshold, the PWM controller adjusts
the reference voltage or the frequency of the ramp signal to reduce the
frequency of the PWM signal, thereby reducing the switching loss caused
by the switches.