Past exam question: 2076 Chaitra, Q7
Open in the Padhaiko appConstruct a (7, 4) Hamming code using a 4×4 generation matrix for any arbritery message.
Solution
Structure of the Systematic (7, 4) Hamming Code: For a Hamming code:
- Codeword block length:
- Message data length:
- Parity check bits:
The systematic generator matrix has dimensions . It is partitioned into a identity matrix and a parity submatrix (the prompt refers to the generator construction using the identity core with parity assignment):
Here, each row of parity submatrix has Hamming weight and all rows are distinct.
Encoding an Arbitrary Message Vector: Let us choose an arbitrary 4-bit message:
The systematic 7-bit codeword is obtained by vector-matrix multiplication modulo 2:
- The first 4 bits reproduce the message identically:
- The remaining 3 bits are parity checks :
Final Codeword Verification: The constructed codeword is:
The parity check matrix is:
Multiplying :
Since syndrome , the codeword is mathematically valid.
The systematic Hamming generator matrix is:
For arbitrary message , the encoded 7-bit codeword is .