CS FundamentalsVery hardProduct company interview · GATE level

A 12-bit Hamming codeword protects 8 data bits. Positions are numbered 1 to 12 from the left, even-parity check bits sit at positions 1, 2, 4 and 8 (the check bit at position p covers every position whose binary number has bit p set), and data bits fill positions 3, 5, 6, 7, 9, 10, 11, 12 in order. The word 001001110000 is received with at most one bit in error. Which position is in error, and what 8 data bits were sent?

  1. A. Position 10; data 10110100
  2. B. No data bit is wrong; data 10110000
  3. C. Position 5; data 11110000
  4. D. Position 12; data 10110001

Correct answer: A. Position 10; data 10110100

Recompute the four parity checks on 001001110000: check 1 (positions 1,3,5,7,9,11) is even, check 2 (2,3,6,7,10,11) is odd, check 4 (4,5,6,7,12) is even, check 8 (8,9,10,11,12) is odd. The failing checks sum to 2 + 8 = 10, so position 10 is wrong. Flipping it gives 001001110100, whose data bits (positions 3,5,6,7,9,10,11,12) are 10110100. Reading the syndrome bits in reverse order points to position 5, which is the trap; leaving the word uncorrected gives 10110000.

More Computer Networks questions

Exams that ask this topic