A PWM buck-or-boost converter is provided. The converter includes an error
amplifier, a rectifier/splitter, a first comparator, and a second
comparator. The rectifier/splitter provides two signals proportional to
the departure of the error voltage from a central value but increasing in
value from zero. Only one of the two signals departs from zero depending
on the error voltage. The first comparator compares one of the two
signals to a modulating waveform (e.g. a sawtooth waveform), and the
second comparator compares the other of the two signals to the modulating
waveform. Only one of the two signals intersects the modulating waveform
depending on the error voltage. During buck regulation, the first
comparator controls the buck switches and the output of the second
comparator remains high. During boost regulation, the second comparator
controls the boost switches and the output of the first comparator
remains high.