CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Hamming's Correction of Single Errors, continued

When a codeword is received at the other end we must check (and possibly correct) it.

To correct when it arrives:

Initialize a counter, c, to 0.

Examine each check bit in position k={1,2,4,8} to see if it has the correct parity.

If not, add k to c.

When all check bits have been examined, and counter c is 0, then codeword is correct. Otherwise, the incorrect bit is in position c.

For example, if we transmit 11111000011 (from before), but we receive :

      1  2  3  4  5  6  7  8  9 10 11
     ---------------------------------
      1  1  1  1  1  0  0  0  0  1  0

c=0
k=1	parity for 3,5,7,9,11	wrong! so  c+=k  (=1)
k=2	parity for 3,6,7,10,11	wrong! so  c+=k  (=3)
k=4	parity for 5,6,7	correct
k=8	parity for 9,10,11	wrong! so  c+=k  (=11)

Hence bit 11 is in error!


CITS3002 Computer Networks, Lecture 2, The Physical Layer, Errors detection and correction, p14, 6th March 2024.