Abstract. It is expected that commodity hardware is becoming less reliable because of the continuously decreasing feature sizes of integrated circuits. Nevertheless, more and more commodity hardware with insufficient error detection is used in critical applications. One possible solution is to detect hardware errors in software using arithmetic AN-codes. These codes detect hardware errors independent of the actual failure modes of the underlying hardware. However, measurements have shown that AN-codes still exhibit large rates of undetected silent data corruptions (SDC). These high rates of undetected SDCs are caused by the insufficient protection of control and data flow through AN-codes. In contrast, ANB-and ANBD-codes promise much higher error detection rates because they also detect errors in control and data flow. We present our encoding compiler that automatically applies either an AN-, ANBor ANBD-code to an application. Our error injections show that AN-, ANB-, and ANBD-codes successfully detect errors and more important that indeed ANB-and ANBD-codes reduce the SDC rate more effectively than AN-codes. The difference between ANBD-and ANB-codes is also visible but less pronounced.