| ISSUE 415/456 · COMPUTER SCIENCE |
~4 MIN |
FOUNDATION / COMPUTER SCIENCE · READING DATE 2027-11-20 · NOVEMBER 2027 — MATTER AND COMPUTATION LIMITS
How three checks can locate one wrong bit
START HERE
A computer stores information as bits, digits that are each either 0 or 1. A Hamming code adds carefully overlapping checking bits so that a single wrong bit can be located and corrected. It stores extra information before damage occurs, giving the receiver evidence that the original message alone would not contain.
|
/ WHY NOW
One check can tell you that something is wrong without telling you where. Several checks, each watching a different group, can make the pattern of failures point to one particular position.
|
/ THE IDEA
A bit is a 0 or 1. An even-parity check passes when its selected group contains an even number of 1s. In a seven-bit Hamming word, positions 1, 2 and 4 hold checking bits, while positions 3, 5, 6 and 7 hold the four data bits. Check 1 watches positions 1, 3, 5 and 7. Check 2 watches 2, 3, 6 and 7. Check 4 watches 4, 5, 6 and 7. Every position belongs to a unique combination of checks, so one flipped bit creates a unique failure pattern.
THE FORMAL IDEA
error position = s₁ + 2s₂ + 4s₄
| s₁, s₂ and s₄ are 1 when the corresponding even-parity check fails, otherwise 0. | | The result is a position count from 1 to 7. A result of zero means no detected error under the single-error model; there are no physical measurement units. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Data 1011 in positions 3, 5, 6, 7 give valid word 0110011. Flip position 6: the received word is 0110001. Checks 2 and 4 fail, so position = 0 + 2 + 4 = 6; flip it back. Change the damage to position 5 instead: checks 1 and 4 fail, giving 1 + 0 + 4 = 5.
|
The overlapping groups turn failure information into an address. The receiver does not need to know the original data in advance: it uses the consistency rules built into every valid encoded word. Correcting the identified position restores the four data bits for either single-bit change.
/ SO WHAT?
The price is three extra stored or transmitted bits for four useful data bits in this small example. That is redundancy with a specific job, rather than duplication for its own sake. Different codes choose different overheads and protect against different kinds or numbers of damage.
ONE CAVEAT |
| This seven-bit code corrects one error, not an arbitrary damaged message. Two flips can mimic a different single error and cause miscorrection; an extended Hamming code adds another parity check to detect double errors. |
KEEP THIS
To locate damage rather than merely notice it, arrange overlapping checks so each protected position produces its own recognisable failure pattern.
|
NEXT: Why a coil objects when its current suddenly stops
|