A method for controlling a peak current is provided. The method first uses
a plurality of registers to encode a plurality of states of a circuit and
generates an original state code. Then, the original state code is
re-encoded to reduce the difference between the sum of charging current
of the charged registers and the sum of discharging current of the
discharged registers while the registers are switched among the
charging/discharging states. Finally, a standard technology library is
read and logic circuit synthesis is performed for the re-encoded state
codes.