CS485 Sylabus

### Hamming code: decoding procedure

• Decoding a Hamming coded message

• Checking the correctness of a received message:

• Converting the index of the 1 bit locations into a binary number

• Perform the XOR operations on all resulting binary numbers

• If the result = 0 then the messages (most likely) contains no error

 The decoded message consists of the received bits minus the bits at at positions: 20, 21, 22, ..., 2k

• If the result <= length of the message then the messages (most likely) contains 1 error

 Change the value of the bit at the position given by "result" (computed above) The decoded message consists of the received bits minus the bits at at positions: 20, 21, 22, ..., 2k

• If the result > length of the message then the messages (most likely) contains multiple errors

 The receiver cannot perform correction It will reject the message as corrupted

• Example: 101010

From the discussion above:

we know that the sender will transmit: 1011010000

• Case 1: transmission was received with no error

Outcome of the decode procedure:

Result:

• XOR result = 0

Conclusion:

 Message has no error (which was what happened !)

• Case 2: transmission was received with one bit error

Outcome of the decode procedure:

Result:

• XOR result = 0111 = 7 ( ≤ 10 (message length))

Conclusion:

 Message has 1 bit error at bit position 7 (which was what happened !)

(Try with a bit error in some other position !)

Case 3: transmission was received with (detectable) two bits error

 Received message = 1110010000 (Bit positions 7 and 9 were received in error)

Outcome of the decode procedure:

Result:

• XOR result = 1110 = 14 ( > 10 (message length))

Conclusion:

 Message has multiple bit errors -- correcting is impossible (which was what happened !)

• Warning: multiple error can cause errorneous correction in Hamming procedure

• Fact:

 Some multiple bit errors will cause the Hamming decode procedure to believe that there was a single bit error

• Example:

• We use the same example:

 ``` Hamming encode message: 1011010000 (original message was: 101010 ```

• Suppose bit positions 6 and 7 were received in error:

 ``` Received message = 1010110000 ```

• Outcome of the decode procedure:

Result:

• XOR result = 0001 = 1 ( ≤ 10 (message length))

Conclusion:

 Messages has 1 bit error at bit position 1... (This is wrong !!!)