Hamming code for 01100011110
The Hamming(15,11) code is an error-correcting code that adds four parity bits to an 11-bit data word, creating a 15-bit codeword. Here's a step-by-step guide to calculate the Hamming(15,11) code for binary number 01100011110:
Collect the 11-bit data word that you want to encode. For example, let's say you have a data word: 01100011110.
Identify the positions for the four parity bits (P1, P2, P4, P8). These bits will be placed at positions 1, 2, 4, and 8 of the 15-bit codeword. The other positions (3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15) - (D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11) will be filled with the data bits.
In our example: D1 - 0, D2 - 1, D3 - 1, D4 - 0, D5 - 0, D6 - 0, D7 - 1, D8 - 1, D9 - 1, D10 - 1, D11 - 0.
Calculate the values of the parity bits based on the data bits.
Parity Bit P1:
- P1 covers D1, D2, D4, D5, D7, D9, D11
- Calculate the parity over the data bits in these positions (inclusive). Set P1 to 1 if the total number of 1s is odd, otherwise set it to 0.
P1 = (0 + 1 + 0 + 0 + 1 + 1 + 0) % 2 = 1
Parity Bit P2:
- P2 covers D1, D3, D4, D6, D7, D10, D11
- Calculate the parity over the data bits in these positions (inclusive). Set P2 to 1 if the total number of 1s is odd, otherwise set it to 0.
P2 = (0 + 1 + 0 + 0 + 1 + 1 + 0) % 2 = 1
Parity Bit P4:
- P3 covers D2, D3, D4, D8, D9, D10, D11
- Calculate the parity over the data bits in these positions (inclusive). Set P4 to 1 if the total number of 1s is odd, otherwise set it to 0.
P4 = (1 + 1 + 0 + 1 + 1 + 1 + 0) % 2 = 1
Parity Bit P8:
- P8 covers D5, D6, D7, D8, D9, D10, D11
- Calculate the parity over the data bits in these positions (inclusive). Set P8 to 1 if the total number of 1s is odd, otherwise set it to 0.
P8 = (0 + 0 + 1 + 1 + 1 + 1 + 0) % 2 = 0
Insert the calculated parity bits into their respective positions in the codeword.