16
16
=>!+" +1
For example, if the value of m is 7 (as in a 7-bit ASCII
code), the smallest r value that can satisfy this equation is
4:
2
4
=>7 + 4+l
Ass.Prof.Dr. Thamer Information theory 4th class in Communications
13
Table 1 shows some possible m values and the
corresponding r values.
Hamming Code
Hamming provides a practical solution. The Hamming code
can be applied to data units of any length and uses the
relationship between data and redundancy bits discussed
above. For example, a 7-bit ASCII code requires 4
redundancy bits that can be added 10 the end of the data
unit or interspersed with the original data bits. In Figure 17,
these bits are placed in positions 1, 2 ,4, and 8 (the
positions in an 11-bit sequence that are powers of 2). For
clarity in the examples below, we refer to these bits as r
1
, r
2
,
r
4
, and r
8
.
Fi.17
Ass.Prof.Dr. Thamer Information theory 4th class in Communications
14
In the Hamming code, each r bit is the parity bit for one
combination of data bits, is shown below:
Also Figures 18 and 19 explains the calculations of the
redundancy bits.
Fig.18
Ass.Prof.Dr. Thamer Information theory 4th class in Communications
15
Fig. 19
Now imagine that by the time the above transmission is
received, the number 7 bit has been changed from 1 to 0.
The receiver takes the transmission and recalculates 4 new
parity bits, using the same sets of bits used by the sender
plus the relevant parity r bit for each set (sec Fig. 20). Then
it assembles the new parity values into a binary number in
order of r position( r
8
r
4
, r
2
, r
1
). In our example, this step
gives us the binary number 0111 (7 in decimal), which is the
precise location of the bit in error.
Ass.Prof.Dr. Thamer Information theory 4th class in Communications
16
Fig .20
Once the bit is identified, the receiver can reverse its
value and correct the error. The beauty of the technique is
that it can easily be implemented in hardware and the code
is corrected before the receiver knows about it.