encode | decode | compress

> hamming | (7,4) | ecc <

// Hamming Code - Error correction code for reliable data transmission

[CORRECTION]

Error Correction

Automatically detects and corrects single-bit errors in data.

[DETECTION]

Double Error Detection

Can detect (but not correct) two-bit errors in each block.

[EFFICIENT]

Minimal Overhead

Only 3 parity bits for every 4 data bits (75% efficiency).

>> technical info

How Hamming Code Works:

Hamming(7,4) code adds 3 parity bits to every 4 data bits, creating 7-bit blocks. Parity bits are placed at positions that are powers of 2 (1, 2, 4). When errors occur, the syndrome (parity check result) points directly to the error position.

Hamming(7,4) Structure:

Data: 1011 (4 bits) Positions: P1 P2 D1 P3 D2 D3 D4 Hamming: 1 0 1 1 0 1 1 P1 = D1 ⊕ D2 ⊕ D4 = 1 ⊕ 0 ⊕ 1 = 0 P2 = D1 ⊕ D3 ⊕ D4 = 1 ⊕ 1 ⊕ 1 = 1 P3 = D2 ⊕ D3 ⊕ D4 = 0 ⊕ 1 ⊕ 1 = 0

Why Use Hamming Code:

  • >Memory error correction
  • >Satellite communication
  • >Data storage systems
  • >Network transmission
  • >RAID arrays

>> frequently asked questions

What is Hamming code?

Hamming code is an error correction code invented by Richard Hamming in 1950. It adds parity bits to data that allow automatic detection and correction of single-bit errors.

What does (7,4) mean?

Hamming(7,4) means 7 total bits with 4 data bits and 3 parity bits. It can correct any single-bit error in the 7-bit block. Other variants include (15,11) and (31,26).

How does error correction work?

When receiving data, parity bits are recalculated. If they don't match, the syndrome (difference) directly indicates which bit is wrong. The error is fixed by flipping that bit.

Hamming vs other ECC?

Hamming code is simple and efficient for single-bit errors. More complex codes like Reed-Solomon can correct multiple errors but have higher overhead. Hamming is perfect for low-noise channels.

Other Languages