← The collection

Hamming Code.

Flip transmitted bits and discover what one-error correction can and cannot repair.

Interactive experimentintuitiveField note ·
Preparing the experiment…
THE SHORT VERSION

Hamming Code, explained.

A Hamming(7,4) code encodes four data bits with three parity bits, allowing correction of any single-bit transmission error under the single-error assumption.

01 / THE MECHANISM

Why it happens

Data occupies positions 3,5,6,7 and even parity positions 1,2,4. Toggle errors, XOR positions of received one bits to get a syndrome, flip that position if nonzero and read data. Compare recovered data with the known original; the decoder does not know the injected-error count.

A Hamming(7,4) code encodes four data bits with three parity bits, allowing correction of any single-bit transmission error under the single-error assumption.

Read the result

Distinguish injected errors known by the simulator from the syndrome known by the decoder. A nonzero syndrome is interpreted under a one-error assumption.

02 / FOLLOW IT THROUGH

A worked example

One damaged bit and then two

  1. Encode the default four data bits and flip one transmission bit before decoding; compare the recovered data with the original.

  2. Reset, flip two different transmission bits and decode again using the same single-error correction rule.

  3. Inspect a possible mismatch: a two-error syndrome can point to a third position, causing a wrong correction instead of identifying both errors.

OPTIONAL DEEPER DETAILGo deeper: inside the model

Inside this model

Data occupies positions 3,5,6,7 and even parity positions 1,2,4. Toggle errors, XOR positions of received one bits to get a syndrome, flip that position if nonzero and read data. Compare recovered data with the known original; the decoder does not know the injected-error count.

03 / BEYOND THE EXPERIMENT

Where this idea is useful

A practical use

Redundant structure can recover information from noise while still having a precise limit on the errors it can correct.

CHECK YOUR INTUITION

A common misconception

THE TEMPTING CONCLUSION

“Adding parity makes any corrupted message recoverable.”

THE MORE USEFUL DISTINCTION

Codes have precise distance-based limits. Hamming(7,4) corrects one error; this decoder cannot reliably distinguish a single error from multiple errors without extra structure.

What this explanation leaves out

  • Two errors can cause this single-error decoder to miscorrect. The simulator's injected count is extra ground truth, not a decoder capability. Extended SECDED adds another parity bit; no real communication channel is being tested.
ONE MORE QUESTION

Why display the original data if a receiver would not know it?

The original is simulator ground truth for checking the demonstration. It is not supplied to the decoding calculation and does not improve the code's capabilities.

TAKE THE IDEA WITH YOU

What failure does your redundancy scheme detect, and what failure can it actually repair?

Associated thinkers

Associated withRichard Hamming ↗

Associations marked provisional are awaiting source review.

Further reading

Explore the original research or the teaching reference behind this experiment.