Biology for Computer Engineers Course Handout.pptx
Error detection and Correction
1. Gandhinagar Institute of Technology
MCWC ALA
Topic: Error Correction and Error Detection
Prepared By:
Tarj Mehta (170120107074)
Guided By: Prof. Parita Shah
2. Introduction
• For reliable communication, errors must be detected and corrected.
• The data may get corrupted during transmission.
• The data link layer uses some error control mechanism to ensure that
frames (stream of data bits) are transmitted with accuracy.
• In OSI model, error detection and correction are implemented either
at data link layer or transport layer.
4. Error Detection
• It uses concept of redundancy, means adding extra bits for detecting
errors at receiving-end.
• There are 3 methods:
1. Parity Check
2. Cyclic redundancy check
3. Checksum
5. Parity Check
• An extra bit is added at the end of data and number of 1’s remain
even.
• If block has even number of 1’s, 0 is added at the end.
• If block has odd number of 1’s, 1 is added at the end.
• On the receiver side parity bit is computed and check with received
data.
6. • Sender:
Data: 1 1 0 1 0 0
As it has odd number of 1’s, 1 will be added
With parity: 1 1 0 1 0 0 1
• This will be transmitted via transmitting media.
• Receiver:
Parity bit will be computed.
If parity bit are correct (1 1 0 1 0 0 1) then only data will be accepted
otherwise it will be rejected.
• Disadvantage: Error in more than one bit cannot be detected.
7. Cyclic Redundancy check
• In this method parity bits are calculated for each row and column and
are sent along with data to the receiver.
• At receiving end these are compared with the parity bits calculated
on the received data.
• Suppose, the given data: 1101101 and divisor: 10101
• Append 4 zeros at the end of data (divisor – 1)
• Division is done by X – OR.
8. _1110111______
10101 | 11011010000
| 10101
011100
10101
010011
10101
001100
00000
011000
10101
011010 The remainder is not 0, so there is some
10101 error. Now, Append the remainder to data
011110
10101
01011
10. Checksum
• The given data is divided into data segments of k size.
• Each segment is added using 1’s complement method and at the end
they are complemented and the check sum is sent along with data
segments.
• At the receiving end all the segments are added with checksum.
• If the answer is 0, the data is accepted.
• If there is any tampering with the bits, the answer will not be 0 and
error can be detected.
11. Example
• Question: 10110011 10101011 01011010 11010101
10110011
10101011
1| 01011110
1
01011111
01011010
10111001
11010101
1| 10001111
1
10001111 Now 1’s complement is: 0111000 (checksum)
12. • Performing the addition again with check sum block…
10110011
10101011
1| 01011110
1
01011111
01011010
10111001
11010101
1| 10001110
1
10001111
01110000
11111111
Complementing this we get 00000000, hence data will be accepted.
14. Hamming Code
• It is a set of error correction codes that can be used to detect and
correct the errors encountered during transmission.
• It has various steps to detect and correct the error.
• Example: A 7bit hamming code is received as 1011011. Assume even
parity and state whether the received code is correct or wrong, if
wrong locate the bit in error.
16. • Step3: Analyzing bits P4 D5 D6 D7
1 1 0 1 = odd 1’s = error exists
Keeping P4=1
Here, P4 and P1 are not equal to zero.
Correcting Error: E =
Decimal value for 101 is 5, which shows that 5th bit is error bit.
So, we write correct word by simply inverting 5th bit.
Final answer: 1001011
P4 P2 P1
1 0 1