A system is provided, which includes a rotatable gantry for receiving an
object to be scanned. The system includes an x-ray source for projecting
x-rays of two different energy levels towards the object and also a power
supply, which energizes the x-ray source to two different voltage levels
at a predetermined rate for generating x-rays at two different energy
levels. The power supply in the system includes a fixed voltage source to
input a voltage to a switching module with number of identical switching
stages. Each stage in the switching module consists of a first switch,
which charges a capacitor in a conducting state and output a first
voltage, a second switch, which connects the fixed voltage source and the
capacitor in series to output a second voltage in a conducting state and
a diode which blocks a reverse current from the capacitor to the power
supply.