Hamming code: Difference between revisions

Content deleted Content added
m avoid unnec redirect
m clean up, typo(s) fixed: 2-3 → 2–3 (3)
Line 1:
{{short description|Family of linear error-correcting codes}}
{{More footnotes needed|date=March 2013}}
 
{{Infobox code
Line 73:
# Each data bit is included in a unique set of 2 or more parity bits, as determined by the binary form of its bit position.
## Parity bit 1 covers all bit positions which have the '''least''' significant bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.
## Parity bit 2 covers all bit positions which have the '''second''' least significant bit set: bits 2-32–3, 6-76–7, 10-1110–11, etc.
## Parity bit 4 covers all bit positions which have the '''third''' least significant bit set: bits 4–7, 12–15, 20–23, etc.
## Parity bit 8 covers all bit positions which have the '''fourth''' least significant bit set: bits 8–15, 24–31, 40–47, etc.
Line 80:
If a byte of data to be encoded is 10011010, then the data word (using _ to represent the parity bits) would be __1_001_1010, and the code word is 011100101010.
 
The choice of the parity, even or odd, is irrelevant but the same choice must be used for both encoding and decoding.
 
This general rule can be shown visually:
Line 161:
{{main|Hamming(7,4)}}
 
In 1950, Hamming introduced the [7,4] Hamming code. It encodes four data bits into seven bits by adding three parity bits. As explained earlier, it can either detect and correct single-bit errors or it can detect (but not correct) both single and double-bit errors.
 
With the addition of an overall parity bit, it becomes the [8,4] extended Hamming code and can both detect and correct single-bit errors and detect (but not correct) double-bit errors.