A PWM regulator is operated either a buck mode or a boost mode depending
on whether the input voltage is above or below the desired regulated
output voltage. The technique uses two sawtooth ramps 180 degrees out of
phase. Where the two ramps cross each other is a buck/boost transition
level. An error voltage, corresponding to a required duty cycle to
achieve a regulated voltage, is compared to the two ramps. The transition
from one mode to the other occurs when the error voltage passes the
buck/boost transition level of the two ramps. A logic circuit supplies
PWM pulses to either buck switching transistors or the boost switching
transistors in a power stage of the regulator, depending on the whether
the error voltage is above or below the buck/boost transition level, to
achieve the regulated voltage.