Error detection code Lecture-10
Error detection code Lecture-10
Lecture#10
Error Detecting & Correcting Codes in Digital Electronics
Cj = 0 0 0 1 0 1 1
Here, these code words differ in the leftmost bit position and in the
fourth and fifth bit positions from the left. Accordingly, d ij =3.
From Hamming’s analysis of code distances, the following important
properties have been derived:
A minimum distance of at least two is required for single error
detection.
Since the number of errors, E ≤[(dmin-1)/2], a minimum distance
of three is required for single error correction.
Greater distances will provide detection and /or correction of
more number of errors.
The 7-bit Hamming (7, 4) code word h1h2 h3 h4 h5 h6 h7 associated with a
4-bit binary number b3 b2 b1 b0 is:
h3=b3
h5=b2
h6 =b1
h7=b0
Where denotes the Exclusive-OR operation. Note that bits h1, h2 and h4
are even parity bits for the bit fields b 3b2b0, b3b1b0 and b2b1b0
respectively. In general, the parity bits (h 1, h2, h4, h8,…….) are located in
the positions corresponding to ascending powers of two (i.e., 2 0, 21, 22,
23, ………..=1, 2, 4, 8, ………..)
The h1 parity bit has a 1 in the LSB of its binary representation.
Therefore, it checks all bit positions, including those which
have 1’s in the same location (i.e., LSB) in the binary
representation (i.e., h1, h3, h5 and h7). The binary representation
of h2, has a 1 in the middle bit. Therefore, it checks all bit
positions, including those which have 1’s in the same location
(i.e., middle bit) in the binary representation (i.e., h 2, h3, h6 and
h7). The binary representation of h 4 has a 1 in the MSB.
Therefore, it checks all bit positions, including those which
have 1’s in the same location (i.e., MSB) in the binary
representation (i.e., h4, h5, h6 and h7).
To decode a hamming code, one must check for odd parity over the
bit fields in which even parity was previously established. For
example, a single bit error is indicated by a non-zero parity word c 4,
c2, c1 where
=0 1 1=0
h3=b3 =0
=0 0 1=1
h5=b2 =1
=1 0 1=0 h6 =b1 =0
h7=b0 =1
h1 h2 h3 h4 h 5 h 6 h 7
0 1 0 0 1 0 1
A 7-bit Hamming code is received as 0101101. What is its correct
code?
Sol: h1 h2 h3 h4 h 5 h 6 h 7
0 1 0 1 1 0 1
=0 0 1+1 =0 0 0 1=0
1 0 1=1
Thus C4 C2 C1= 1 0 0. Therefore, bit 4 is in error and the
corrected code word can be obtained by complementing the
fourth bit in the received code word as 0100 101
Thank You