Error Detection & Correction Codes
Error Detection & Correction Codes
S.Kavitha
Head & Assistant Professor
Department of Computer Science
Sri Sarada Niketan College of Science for Women,Karur.
• 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.
• Example − Parity code, Hamming code.
• Error correction codes − are used to correct
the errors present in the received
data bitstream so that, we will get the original
data. Error correction codes also use the
similar strategy of error detection
codes.Example − Hamming code.
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.
Even Parity Code
• 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.
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+12≥1
Where,n’ is the number of bits in the binary
code information
• ‘k’ is the number of parity bits
• Therefore, the number of bits in the Hamming code is
equal to n + k.
• Let the Hamming
code is bn+kbn+k−1.....b3b2b1−1.....321 &
parity bits pk,pk−1,....p1,−1,....1. 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 suffixes in their equivalent binary have ‘1’ in the place
value of 20.
• 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 21.
• 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 22.
• 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 20.
• 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 21.
• 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 suffixes in their equivalent binary have ‘1’ in the
place value of 22.
• Similarly, find other values of check bits.