GATE / CS ARCHIVE

SIMILAR QUESTIONS / DIGITAL LOGIC

Apply Hamming parity-check equations

2 questions solved the same way, newest first. Back to Digital Logic

How these are solved

Associate parity bit 2^k with positions whose binary index includes bit k, form even-parity equations/syndrome, then correct a single error or solve missing bits.

2 marks · MCQ
Report issue

Binary Codes & Error Detection

Question 29, GATE 2021: A 12-bit Hamming codeword is d8 d7 d6 d5 c8 d4 d3 d2 c4 d1 c2 c1, listed from left to right. Data d8...d1 are 1,1,0,x,0,1,0,1; check bits c8,c4,c2,c1 are y,0,1,0. Find x,y. A 0,0; B 0,1; C 1,0; D 1,1.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (5 steps)

Number codeword positions from the right. The c2 parity group at positions 2, 3, 6, 7, 10, 11 already has four ones, establishing even parity. The c1 group at 1, 3, 5, 7, 9, 11 has 2+x ones, so x=0. The c8 group at 8, 9, 10, 11, 12 then has y+2 ones, so y=0. Thus A. This uses the parity convention inferred from the supplied known check group, not an unprovided arbitrary choice.

The positions from right to left are 1:c1=0,2:c2=1,3:d1=1,4:c4=0,5:d2=0,6:d3=1,7:d4=0,8:c8=y,9:d5=x,10:d6=0,11:d7=1,12:d8=1. Each parity check includes positions whose binary index has its corresponding bit set. After x=y=0, c4's group {4,5,6,7,12} also has two ones, verifying consistency with the parity convention inferred from c2.

Original paper, page 25 · Answer key

5 marks · Descriptive
Report issue

Hamming (7,4) syndrome

Binary Codes & Error Detection

Question 9, GATE 1994: A received seven-bit single-error-correcting Hamming word has positions 7,6,5,4,3,2,1 containing 1,0,0,0,1,1,0 respectively. Assuming at most one corrupted bit, determine correctness and, if needed, correct it.
Tap to enlarge
Answer & solution

Answer: Even parity: bit 6 is wrong, corrected word 1100110. Odd parity: bit 1 is wrong, corrected word 1000111. (no official key was published)

1. Parity checks cover positions {1,3,5,7}, {2,3,6,7}, {4,5,6,7}. Their received XORs are 0,1,1.

2. For even parity each expected XOR is zero. The failure vector (s4,s2,s1)=110₂=6 locates bit 6; flip its 0 to 1 to obtain 1100110 in position order 7 through 1. All three checks then equal zero.

3. For odd parity each expected XOR is one. The failure vector is 001₂=1, so flip bit 1 from 0 to 1 to obtain 1000111 in position order 7 through 1. All three checks then equal one.

4. Because the source does not specify the parity convention, one cannot select a unique corrected word without stating an assumption.

Diagram / structural description

Position: 7 6 5 4 3 2 1
Received: 1 0 0 0 1 1 0

  • Neither the paper explicitly specifies even or odd parity.

Original paper, page 5