The controller 306 may include a pulse width modulator, PWM, or a digital pulse width modulator, DPWM, to be used with the buck and boost converter circuits. Controller 306 controls both the buck converter and the boost converter and determines whether a buck or a boost operation is to be performed. In some circumstances both the buck and boost portions may operate together. That is, the input voltage and current are selected independently of the selection of output current and voltage. Moreover, the selection of either input or output values may change at any given moment depending on the operation of the DC power sources. Therefore, in the embodiment of