This Python Tkinter application demonstrates the Hamming code algorithm for error detection and correction. The visualizer guides users through generating Hamming codes for input data bits, simulating errors by flipping bits, and automatically detecting and correcting single-bit errors. It offers detailed, step-by-step visualization in an intuitive, professional GUI.
- Interactive input and output panels
- Step-by-step parity calculation and encoding visualization
- Error simulation with user-specified bit flipping
- Automatic error detection and correction display
- Tabbed interface separating encoding steps and final results
- Modern, accessible color scheme and layout
- Ensure Python 3.6+ is installed with Tkinter support
- Download or clone this repository
- Run the application:
- Enter binary data bits (0s and 1s) in the "Enter Data Bits" field.
- Click "Generate Hamming Code" to encode the data with parity bits.
- Optionally, enter a bit position to flip in "Simulate Bit Error" (enter
0for no error). - Click "Simulate Transmission & Detect Error" to simulate transmission, detect any error, and show correction.
- Review the detailed encoding steps and final results in their respective tabs.
- Calculate the number of parity bits needed based on message length.
- Insert parity bits at positions that are powers of two.
- Calculate parity bits by XORing appropriate positions.
- Transmit encoded message containing data and parity bits.
- At the receiver, recalculate parity bits to detect any single-bit error.
- Correct the error automatically if detected.
Original Data: 1010
Encoded Message: 1010010
Sent: 1010010
Received: 1010110
Error introduced at position 3 (from right)
DETECTION RESULT: ✗ Error at position 3
Corrected Message: 1010010
✓ Successfully corrected single-bit error!
### Detection and correction
### Results:
This project is licensed under the MIT License.
Shubham Yadav
⭐ Star this repository if you find this project helpful for learning error correction and Hamming codes!