The invention provides an electronic device capable of quickly and accurately detecting a hard disk state. The electronic device comprises a plurality of hard disk drivers, a south bridge PCH (
Platform Controller Hub), a programmable device CPLD (
Complex Programmable Logic Device), a substrate controller BMC (Block
Multiplexer Channel) and a storage device, wherein the PCH is used for detecting the working states of the hard disk drivers, and sending a
signal to the programmable device CPLD through a
SGPIO (Serial
General Purpose Input Output) protocol when the hard disk drivers have errors. The CPLD is used for decoding the
signal, and transmitting the decoded data to the BMC through a GPIO mode. The electronic device can be used for transmitting the data by replacing the GPIO mode with an I2C mode, so that an internal
data path of the CPLD cannot be blocked, and
data delay and loss are avoided; the data volume processed by the CPLD is reduced greatly, so that the working efficiency is improved; moreover, a drive program corresponding to the I2C mode is not needed to be added to the CPLD, so that the
programming complexity is lowered, and the
programming efficiency is greatly improved.