Hamming Code implementation in Python
Pre-requisite: Hamming Code
Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when the data is moved or stored from the sender to the receiver. It is a technique developed by R.W. Hamming for error correction.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
- Enter the Data to be transmitted
- Calculate the no of redundant bits required
- Determine the parity bits
- Create error data for testing
- Check for errors
Input: 1011001 Output: Data transferred is 10101001110 Error Data is 11101001110 The position of error is 10 Input: 10101111010 Output: Data transferred is 101011111010000 Error Data is 101011111010100 The position of error is 3
Data transferred is 10101001110 Error Data is 11101001110 The position of error is 2