An error detection and correction device , for detecting and/or correcting error(s) of an operation program , comprising: a conversion unit for converting the operation program into a two's complement inverse operation program and converting a plurality of variables of the operation program into a plurality of two's complement variables , and a program execution unit for executing the operation program to obtain a first operation result according to the variables and executing the two's complement inverse operation program to obtain a second operation result according to the two's complement variables , wherein, the error detection and correction device further comprising: a checksum operation unit , for performing the following: calculating a mutual checksum result corresponding to all of the variables according to the operation program , calculating a last checksum result in an operation process corresponding to the variables , calculating a mutual checksum result corresponding to all of the two's complement variables according to the two's complement inverse operation program and calculating a last checksum result in the operation process corresponding to the two's complement variables ; a comparison unit , for performing at least one of the following: comparing the first operation result with the second operation result , comparing the mutual checksum result and the last checksum result corresponding to the variables , or comparing the mutual checksum result and the last checksum result corresponding to the two's complement variables ; and an output unit , for outputting the first operation result , the second operation result or an error message according to a comparison result of the first operation result and the second operation result , a comparison result of the mutual checksum result and the last checksum result corresponding to the variables , or a comparison result of the mutual checksum result and the last checksum result corresponding to the two's complement variables , wherein the operation program accesses the variables from a storage unit , and the two's complement inverse operation program accesses the two's complement variables from the storage unit . a checksum operation unit , for performing the following: calculating a mutual checksum result corresponding to all of the variables according to the operation program , calculating a last checksum result in an operation process corresponding to the variables , calculating a mutual checksum result corresponding to all of the two's complement variables according to the two's complement inverse operation program and calculating a last checksum result in the operation process corresponding to the two's complement variables ; a comparison unit , for performing at least one of the following: comparing the first operation result with the second operation result , comparing the mutual checksum result and the last checksum result corresponding to the variables , or comparing the mutual checksum result and the last checksum result corresponding to the two's complement variables ; and an output unit , for outputting the first operation result , the second operation result or an error message according to a comparison result of the first operation result and the second operation result , a comparison result of the mutual checksum result and the last checksum result corresponding to the variables , or a comparison result of the mutual checksum result and the last checksum result corresponding to the two's complement variables , wherein the operation program accesses the variables from a storage unit , and the two's complement inverse operation program accesses the two's complement variables from the storage unit . <EOS>