Voltage regulators and methods for regulating voltages are disclosed. A
switching circuit with an inductor and a plurality of switches may be
used to produce a regulated voltage from an unregulated voltage source. A
control circuit may be used to monitor the voltages at the input and
output of the voltage regulator, and operate the switches in either a
buck, boost, or buck-boost mode depending on the relationship between the
voltages at the input and output of the voltage regulator.