A power supply includes a first switch to establish a first path to charge an output of the power supply by a voltage source, a second switch to establish a second path to discharge the output, and a third switch connected between the output and a capacitor. When to discharge the output, the third switch is turned on before the second switch turns on, to transfer a portion of energy on the output to the capacitor. When to charge the output, the third switch is turned on before the first switch turns on, to transfer a portion of the energy on the capacitor to the output.