error dect
error dect
That means a bit 0 may change to 1 or a bit 1 may change to 0. We can’t avoid the interference of noise. But, we can
get back the original data first by detecting whether any errors present and then correcting those errors.
Error detection codes − are used to detect the errors present in the received data bitstream. These codes contain
some bits, which are included appended to the original bit stream. These codes detect the error, if it is occurred during
transmission of the original data bitstream.
Parity Code
It is easy to include append one parity bit either to the left of MSB or to the right of LSB of original bit stream. There
are two types of parity codes, namely even parity code and odd parity code based on the type of parity being chosen.
The value of even parity bit should be zero, if even number of ones present in the binary code. Otherwise, it should be
one. So that, even number of ones present in even parity code. Even parity code contains the data bits and even
parity bit.
The following table shows the even parity codes corresponding to each 3-bit binary code. Here, the even parity bit is
included to the right of LSB of binary code.
000 0 0000
001 1 0011
010 1 0101
011 0 0110
100 1 1001
101 0 1010
110 0 1100
111 1 1111
Here, the number of bits present in the even parity codes is 4. So, the possible even number of ones in these even
parity codes are 0, 2 & 4.
If the other system receives one of these even parity codes, then there is no error in the received data. The
bits other than even parity bit are same as that of binary code.
If the other system receives other than even parity codes, then there will be an errors in the received data. In
this case, we can’t predict the original binary code because we don’t know the bit positions of error.
Therefore, even parity bit is useful only for detection of error in the received parity code. But, it is not sufficient to
correct the error.
Odd Parity Code
The value of odd parity bit should be zero, if odd number of ones present in the binary code. Otherwise, it should be
one. So that, odd number of ones present in odd parity code. Odd parity code contains the data bits and odd parity
bit.
The following table shows the odd parity codes corresponding to each 3-bit binary code. Here, the odd parity bit is
included to the right of LSB of binary code.
000 1 0001
001 0 0010
010 0 0100
011 1 0111
100 0 1000
101 1 1011
110 1 1101
111 0 1110
Here, the number of bits present in the odd parity codes is 4. So, the possible odd number of ones in these odd parity
codes are 1 & 3.
If the other system receives one of these odd parity codes, then there is no error in the received data. The bits
other than odd parity bit are same as that of binary code.
If the other system receives other than odd parity codes, then there is an errors in the received data. In this
case, we can’t predict the original binary code because we don’t know the bit positions of error.
Therefore, odd parity bit is useful only for detection of error in the received parity code. But, it is not sufficient to
correct the error.
Hamming Code
Hamming code is useful for both detection and correction of error present in the received data. This code uses multiple
parity bits and we have to place these parity bits in the positions of powers of 2.
The minimum value of 'k' for which the following relation is correct valid is nothing but the required number of parity
bits.
2k≥n+k+1
Where,
Let the Hamming code is bn+kbn+k−1.....b3b2b1& parity bits pk,pk−1,....p11. We can place the ‘k’ parity bits in
powers of 2 positions only. In remaining bit positions, we can place the ‘n’ bits of binary code.
Based on requirement, we can use either even parity or odd parity while forming a Hamming code. But, the same
parity technique should be used in order to find whether any error present in the received data.
Follow this procedure for finding parity bits.
Find the value of p1, based on the number of ones present in bit positions b3, b5, b7 and so on. All these bit
positions suffixesin their equivalent binary have ‘1’ in the place value of 2 0.
Find the value of p2, based on the number of ones present in bit positions b3, b6, b7 and so on. All these bit
positions suffixes in their equivalent binary have ‘1’ in the place value of 2 1.
Find the value of p3, based on the number of ones present in bit positions b5, b6, b7 and so on. All these bit
positions suffixes in their equivalent binary have ‘1’ in the place value of 2 2.
Similarly, find other values of parity bits.
Follow this procedure for finding check bits.
Find the value of c1, based on the number of ones present in bit positions b1, b3, b5, b7 and so on. All these bit
positions suffixes in their equivalent binary have ‘1’ in the place value of 2 0.
Find the value of c2, based on the number of ones present in bit positions b2, b3, b6, b7 and so on. All these bit
positions suffixes in their equivalent binary have ‘1’ in the place value of 2 1.
Find the value of c3, based on the number of ones present in bit positions b4, b5, b6, b7 and so on. All these bit
positions suffixesin their equivalent binary have ‘1’ in the place value of 2 2.
Similarly, find other values of check bits.
The decimal equivalent of the check bits in the received data gives the value of bit position, where the error is present.
Just complement the value present in that bit position. Therefore, we will get the original binary code after removing
parity bits.