The Hamming Code allows for the detection and correction of single bit errors by adding parity bits to the data word. The parity bits are placed in bit positions that are powers of two. Each parity bit checks some subset of the data/parity bits based on its position, and is set to 1 if the number of ones in the checked bits is odd, or 0 if it is even. To locate the position of an error, the parity bits are checked and the positions of any incorrect ones are summed to find the data/parity bit position with the error.