itslabtime.com

Information · Computing · Data Representation

Error detection and Hamming codes

Error-correcting codes add redundant bits to increase the differences between valid data representations. Only a limited number of errors can be guaranteed detectable or correctable.

Related experiment: Error detection and correction →
Error detection and correction
Error detection and correction: simulation view →

Meaning and mechanism

Parity checks whether the number of bits 1 satisfies a specified even or odd condition. Knowing that parity is incorrect is different from knowing which bit to correct.

Hamming(7,4) combines four data bits and three check bits into seven bits. A syndrome formed from several check results can identify a single-bit error position.

Relationships and conditions

The syndrome of a received bit sequence r is calculated as Hrᵀ using binary arithmetic. Assuming a single-bit error, flipping the position indicated by the syndrome restores the original sequence.

The basic Hamming code 7,4) does not guarantee the correction of two bit errors. Simple parity checks can also miss an even number of bit flips.

What to observe in the simulation

Hamming parity checks locate a single-bit error.

Hamming(7,4) guarantees only single-bit correction. Two-bit errors may be miscorrected. Parity detects odd error counts.

Key relationships and symbols

Hamming(7,4) · syndrome = H rᵀ

Symbols and units used in the formulas
SymbolMeaningUnit
HParity-check matrixBinary matrix
rReceived bit sequence7 bit
SyndromeCombination of check resultsBinary vector

Worked example

What if an even number of bits flips under simple parity?

It can miss errors · Hamming parity checks locate a single-bit error.

Common misconceptions

  • Flipping the bit indicated by the syndrome does not guarantee recovery from an arbitrary number of errors.

Explore this concept through experiments

References

OpenStax · Introduction to Computer Science (English)