CPLD-based system state detecting method, CPLD and server mainboard

The invention provides a CPLD-based system state detecting method, a CPLD and a server mainboard. According to the method, each signal line which can reflect the abnormal state of a system is connected with the complex programmable logic device (CPLD), and a prompt message corresponding to the abnormal state of a signal output by each signal line is set. The method comprises the steps that the CPLD acquires the signals output by the signal lines, the CPLD detects the state of each signal and acquiring the prompt message corresponding to a detected abnormal state, and the CPLD controls a display module to conduct displaying according to the acquired prompt message. By the adoption of the scheme, a user can learn about the abnormal state of the system quickly and determines the state of the system according to the abnormal state, and then accuracy is improved.