First I wanna point out a mistake here, it says hamming codeword is 12-bit long, but given codeword sequence is of 13-bit due to repetition of d4 twice (I believe this is a typing error, either they should have write a 13-bit codeword, or d4 occurs only once in this codeword), also 13-bit codeword is very unlikely as it is given in this question, reason: we put check bits at $2^i \ \forall i\ \in N $,
But in the given codeword c8 is at 9th position taken from RHS)
Case 1: assume it’s a 12-bit codeword and d4 is repeated twice by mistake,
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
d8 |
d7 |
d6 |
d5 |
c8 |
d4 |
d3 |
d2 |
c4 |
d1 |
c2 |
c1 |
1 |
1 |
0 |
x |
y |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
(1) $c_1 + d_1 + d_2 + d_4 + d_5 +d_7$ should be of even parity
= 0 + 1 + 0 + 0 + x + 1 = x + 2,
x must be 0 for even parity.
(2) $c_2 + d_1 + d_3 + d_4 + d_6 + d_7$ should be even
= 1 + 1 + 1 + 0 + 0 + 1 = 4 (yes)
(3) $c_4 + d_2 + d_3 + d_4 + d_8$ should be even
= 0 + 0 + 1 + 0 + 1 = 2 (yes even)
(4) $c_8 + d_5 + d_6 + d_7 + d_8$ should be even
= y + x + 0 + 1 + 1 = y + 2 (taking x=0) , for even parity, y should be 0
Hence if code work is of 12-bit, both x and y are 0.
A is correct here
Case 2: It’s a 13-bit codeword, (I don’t think this will be the case, because $c_8$ should be at position 8), but lets try anyway
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
d8 |
d7 |
d6 |
d5 |
c8 |
d4 |
d4 |
d3 |
d2 |
c4 |
d1 |
c2 |
c1 |
1 |
1 |
0 |
x |
y |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
(1) $c_1 + d_1 + d_2 + d_4 + c_8 + d_6 + d_8$ = 0 + 1 + 0 + 0 + y + 0 + 1 = y+2, y will be 0.
(2) $c_2 + d_1 + d_3 + d_4 + d_5 + d_6$ = 1 + 1 + 1 + 0 + x + 0 = x + 3, x will be 1
We may conclude C is correct in this case. but i just wanna check it further for other parity bits whether they holds good or not
(3) $ c_4 + d_2 + d_3 + d_4 + d_7 +d_8$ = 0 + 0 + 1 + 0 + 1 + 1 = 3 (odd parity) , $c_4$ should be 1 for this to be true, which it isn’t)
This case fails, so C is definitely not the answer.