Skip to content

chenavin/hamming-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Hamming (7,4) Code Demonstration

Live Demo

An interactive web demonstration of the Hamming (7,4) single-error correcting code, based entirely on the original Mathematica notebook by Chen Avin.

Overview

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 automatically.

How to use the Demonstration

This demonstration allows you to simulate a transmission:

  1. Set Data Bits: Toggle the four data bits ($d_1, d_2, d_3, d_4$) at the top to configure the word you want to transmit.
  2. Observe Encoding: Watch as the three parity bits ($q_1, q_2, q_3$) are generated and packed into the Transmitted 7-bit word.
  3. Introduce an Error: Use the interactive buttons to simulate a transmission error (flipping a single bit) at any position in the word, or choose None.
  4. Observe Decoding: Watch the receiver calculate the parity checks ($pc_1, pc_2, pc_3$) on the Received word to determine the Error Syndrome.
  5. View Correction: The final corrected word is presented, flawlessly mirroring the original transmission even though an error occurred.

Technologies Used

This project is built using:

  • Pure HTML5 (Semantic table-based grid layout)
  • CSS3 (Custom styling to match the original Mathematica interface)
  • Vanilla JavaScript (Real-time logical bit manipulation and DOM updates)

Credits

Based on the original Mathematica Demonstration.

About

An interactive web demonstration of the Hamming (7,4) single-error correcting code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors