Hamming code: Difference between revisions

Content deleted Content added
Clarified example
Line 115:
Shown are only 20 encoded bits (5 parity, 15 data) but the pattern continues indefinitely. The key thing about Hamming Codes that can be seen from visual inspection is that any given bit is included in a unique set of parity bits. To check for errors, check all of the parity bits. The pattern of errors, called the [[Syndrome decoding|error syndrome]], identifies the bit in error. If all parity bits are correct, there is no error. Otherwise, the sum of the positions of the erroneous parity bits identifies the erroneous bit. For example, if the parity bits in positions 1, 2 and 8 indicate an error, then bit 1+2+8=11 is in error. If only one parity bit indicates an error, the parity bit itself is in error.
 
As you can see, if you haveWith {{mvar|m}} parity bits, it can cover bits from 1 up to <math>2^m-1</math>. Ifcan webe covered. subtractAfter outdiscounting the parity bits, we are left with <math>2^m-m-1</math> bits weremain canfor use for theas data. As {{mvar|m}} varies, we get all the possible Hamming codes:
 
{| class="wikitable" style="text-align:right"