Information Theory and Coding Basics
In a Hamming (7, 4) code, the seven bits are numbered 1 to 7 from the left, and bits 1, 2 and 4 are check bits. They are set so that the number of 1s is even in bits 1, 3, 5 and 7 (check 1), in bits 2, 3, 6 and 7 (check 2) and in bits 4, 5, 6 and 7 (check 4). If the received word 0110001 has a single-bit error, which of the following is the wrong bit?
- ABit 2
- BBit 3
- CBit 6
Show answer and explanation
Answer: C. Bit 6
In the received word 0110001, bits 1, 3, 5 and 7 are 0, 1, 0, 1, an even number of 1s (check 1 gives 0); bits 2, 3, 6 and 7 are 1, 1, 0, 1, odd (check 2 gives 1); and bits 4, 5, 6 and 7 are 0, 0, 0, 1, odd (check 4 gives 1). Reading the results of checks 4, 2 and 1 in that order, 110, as a binary number gives 6, so bit 6 is wrong. Flipping bit 6 gives 0110011, which satisfies all three checks.
- A. 2 is the position of bit 6 counted from the right. This question counts bit 1 from the left.
- B. 3 is the value of 011, the check results read in the order check 1, check 2, check 4. The check with weight 4 should be the most significant digit.
- C. Correct. The check result 110 indicates the wrong position, 6.
Continue: 9 more Information Theory and Coding Basics questions