The Hamming(7,4) Code

​
Data:
1
0
1
1
Parity
​
​
1
0
1

0
​
​
1
1
1

1
​
​
0
1
1

0
​
​
​
​
​
​
​
​
​
​
​
​
​
Transmitted word:
0
1
1
0
0
1
1
​
​
​
​
​
​
​
​
​
​
​
​
​
​
Error:
None
​
​
​
​
​
​
​
​
​
​
​
​
​
Received word:
0
1
1
0
0
0
1
Parity
​
0
1
0
1

0
1
1
0
1

1
0
0
0
1

1
​
​
​
​
​
​
​
​
​
​
​
Error check:
\*SubscriptBox[GridBox[​{​{ItemBox[1, Rule[Background, RGBColor[0.9, 1, 1]​]​, Rule[StripOnInput, False]​]​, ItemBox[1, Rule[Background, RGBColor[1, 1, 0.85`]​]​, Rule[StripOnInput, False]​]​, ItemBox[0, Rule[Background, RGBColor[1, 0.9`, 1]​]​, Rule[StripOnInput, False]​]​}​}​, Rule[AutoDelete, False]​, Rule[GridBoxFrame, List[Rule[Columns, List[List[True]​]​]​, Rule[Rows, List[List[True]​]​]​]​]​, Rule[GridBoxItemSize, List[Rule[Columns, List[List[Automatic]​]​]​, Rule[Rows, List[List[Automatic]​]​]​]​]​]​, Grid]\)\), \(\( \)\(2\)\)\) = \*RowBox[​{6}​]\)
​
​
​
​
​
​
​
​
​
​
​
Corrected word:
0
1
1
0
0
1
1
​
​
​
Hamming(7,4) is a single-error correcting code that uses a 7-bit codeword to transmit four bits of data. The sender computes three parity bits for each 4-bit data word, assembles the data and parity bits into a 7-bit codeword, and transmits this codeword. The receiver computes three parity check bits from the received 7-bit word. If no error occurred in transmission, all three parity check bits will be zero. If a single bit has been changed in transmission, the value of the three parity bits (interpreted as a 3-bit binary number) will indicate the position of the error, which can then be corrected.
This Demonstration allows you to simulate such a transmission by setting the data bits to be transmitted at the top, and introducing an error, if desired, in any position of the transmitted word.

External Links

Hamming Code (Wolfram MathWorld)
Error-Correcting Code (Wolfram MathWorld)

Permanent Citation

Jacob A. Siehler
​
​"The Hamming(7,4) Code"​
​http://demonstrations.wolfram.com/TheHamming74Code/​
​Wolfram Demonstrations Project​
​Published: March 7, 2011