Computers employ a variety of schemes to check whether a chunk of digital information–transmitted as a message, stored in a database, or functioning as a set of instructions–remains error-free. Such error-detection codes would detect, for example, the change of one bit from 0 to 1 or 1 to 0 in corrupted data.
These codes typically rely on the addition of one or more bits to a data string to carry the error-detection information. In a simple binary parity check, a single additional bit would represent whether the total number of “1s” in a given data string is even (1) or odd (0). For example, in the string 1001 0100, the total number of “1s” is odd, so the appended bit would be 1, to generate the new string 1001 0100 1. If one bit changes, the number of “1s” would no longer be odd, and the parity bit would be incorrect, allowing detection of the error.