1. An apparatus for detecting an error, the apparatus comprising: a measuring unit configured to measure a deterministic progress index (DPI) and a program counter (PC) value in response to an instruction being executed; a setting unit configured to set, as a verification set, a DPI and a PC value measured in response to the instruction being executed without an error; and a detector configured to set, as a measurement set, the DPI and the PC value measured by the measuring unit, and to detect a runtime error of the instruction by comparing the DPI value and the PC value of the measurement set to the DPI value and the PC value of the verification set, at every clock cycle of a processor.