The invention provides a design method for power on and off of a Loongson mainboard, in particular relates to a design method for realizing power on and off and
time sequence resetting of a Loongson mainboard by utilizing a state
machine. The design method comprises the following steps of: A, initiating the mainboard into an Idle state; B, after the
machine is started, sending a high level signalof Slp-s5=1 by a south bridge; C, after a
programmable logic device receives the
signal of Slp-s5=1, starting to run the state
machine to enter an S0 state; D, sending a power supply
control logic, aresetting logic of south and north bridges and a resetting logic of a Loongson CPU by the state machine; E, after the machine is started for 4s through long pressing, sending a low level
signal of Slp-s5=0 by the south bridge; F, after the
programmable logic device receives the
signal of Slp-s5=0, enabling the state machine to enter an S5 state; and G, executing the power off state by the state machine, and returning to the Idle state after a 12V power supply is switched off. The method for controlling the power on and off and the
time sequence resetting through the state machine by utilizingthe
programmable logic device, which is provided by the invention, has excellent availability and can stably play the roles of starting up and shutting down.