CS485 Sylabus

### Hamming code: encoding procedure

• The Hamming Code

• Hamming Code:

• Hamming code is a linear error-correcting code named after its inventor, Richard Hamming.

• The Hamming code can:

 Detect and correct all 1 bit errors Detect most 2 bit errors --- but does not detect all 2 bit errors

(It uses a minimum number of extra bits to achieve these properties)

• The encoding procedure of the Hamming code

• How to encode data using Hamming code:

 Input = a sequence of bits (0/1 values) Determine the number of extra bits to insert (see example) Insert the extra bit positions into the input bits Compute the values of the extra bit positions Distribute the computed values into the extra bit positions

• The Hamming encoding procedure illustrated by an example:

1. Input = 101010

2. Determine the number of extra bits to insert:

• The positions that corresponds to a power of 2 are Hamming check bit positions:

• Add extra bit positions at locations:

 20, 21, 22, ... (and so on)

until all data bits can be accommodated

Example: input = 101010

• We need to add one more Hamming check bit:

• We still need to add one more Hamming check bit:

Now we are done !

Note:

 The empty positions are Hamming check bits that will be computed next !!!

3. Compute the values of the bits at the inserted Hamming code positions by:

 Converting the index of the "1" bits of the input data into a binary number Perform the XOR operations column-wise on all the (binary) numbers

Example:

4. Distribute the computed (check) values into the inserted (Hamming) bit positions

Example:

• Summary (of the above):

• If the sender wants to transmit 101010 using Hamming Code, it will transmit:

 1011010000