You are on page 1of 1

HAMMING ERROR-CORRECTION CODES

Messages that are transmitted over a communication channel can be damaged; their bits can be masked or inverted by noise. Detecting and correcting these errors is important. Some simple codes can detect but not correct errors; others can detect and correct one or more errors. The hamming code that can correct a single-bit error and detect a double-bit error. Parity Checking One simple way to detect errors is: 1. Count the number of ones in the binary message. 2. Append one more bit, called the parity bit, to the message 3. Set the parity bit to either 0 or 1, so that the number of ones in the result is even. For example, if the original message contained 17 ones, the parity bit would be a one; if there had been 16 ones, the parity bit would be a zero. 4. Count the number of ones in the received message, including the parity bit. The result will always be even if no errors were encountered. (This approach also works if the parity bit is set to make the count come out odd, as long as the receiver checks for an odd count.) This simple check does have two limitations: it only detects errors, without being able to correct them; and it cant detect errors that invert an even number of bits. Hamming Code Approach Hamming codes are an extension of this simple method that can used to detect and correct a larger set of errors. The basic idea is to have several parity bits (called check bits in Hamming codes) and assign different bits to several overlapping groups. If some parity bits are correct and others are not, the bit in error can be deduced. A very simple example may help to understand this approach. Suppose that the original message is four bits long, numbered from 1 to 4. Then add three check bits as follows: Check bit 1 establishes even parity over itself and data bits 1 and 2 (the first two) Check bit 2 establishes even parity over itself and data bits 1 and 3 (the odd-numbered bits) Check bit 3 establishes even parity over itself and data bits 2 and 4 (the odd-numbered bits) Assuming that only one bit can be in error, it can be determined with the following table:

You might also like