Checksum
• Checksum is an error detection method.
• In checksum error detection scheme, the data is divided into k
segments each of m bits.
• In the sender’s end the segments are added using 1’s complement
arithmetic to get the sum.
• The sum is complemented to get the checksum.
• The checksum segment is sent along with the data segments.
• At the receiver’s end, all received segments are added using 1’s
complement arithmetic to get the sum. The sum is complemented.
• If the result is zero, the received data is accepted; otherwise
discarded.
Compiled by Kalyani Pawar
Checksum Example 1
Suppose the following block of 16 bits is to be sent using a checksum of
8 bits
10101111 01000110
Solution:
At sender side:
10101111
01000110
11110101 Sum
00001010 Checksum(Complement)
The pattern sent is
10101111 01000110 00001010
Data Checksum
Compiled by Kalyani Pawar
• At Receiver Side:
The pattern sent is
10101111 01000110 00001010
Data Checksum
10101111
01000110
00001010
11111111 Sum
00000000 Checksum(1s Complement)
Since we get all zeros after taking 1s complement it
means there is no [Link] receiver will accept
the data.
Page
Compiled by Kalyani Pawar
3
If the pattern sent is
11101111 01100111 00001010
Data Checksum
Will receiver accept the data or reject it?
11101111
01100111
00001010
01011100
1
01011101
01011101 ----------Sum
10100010----------1s complement
Since we do not get all zeros after taking 1s complement it means there is
[Link] receiver will reject the data.
Page
Compiled by Kalyani Pawar
4
Checksum Example 2
Now Suppose the receiver received pattern sent and there is no error .
10101001 00111001 00011101
Data Checksum
Solution:
10101001
00111001
11100010 Sum
00011101 Checksum
Compiled by Kalyani Pawar
Checksum Example 3
Suppose there is burst error that affects 4 bits.
10101001 00111001 00011101
Data Checksum
Solution:
10101111
11111001
00011101
1 11000101 Sum
Result carry 1
11000110
00111001 Checksum(Complement)
All bits in output are not zeros means there is [Link] ,the bit
pattern is corrupted.
Compiled by Kalyani Pawar
Video on Checksum
Page
Compiled by Kalyani Pawar
7
Cyclic redundancy check (CRC)
• Unlike checksum scheme, which is based on addition, CRC is based on binary
division.
• In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
• At the destination, the incoming data unit is divided by the same number. If at this
step there is no remainder, the data unit is assumed to be correct and is therefore
accepted.
• A remainder indicates that the data unit has been damaged in transit and therefore
must be rejected.
Compiled by Kalyani Pawar
3
Page
Compiled by Kalyani Pawar
9
X-OR Truth Table
Page
Compiled by Kalyani Pawar
10
CRC Encoder
Page
Compiled by Kalyani Pawar
11
CRC decoder
Page
Compiled by Kalyani Pawar
12
Video on CRC
Page
Compiled by Kalyani Pawar
13
• Example Calculation
• Let’s calculate CRC for:
• Message (M) = 101
• Generator Polynomial (G) = 110010
• Step 1: Append Zeros
• Since G(X) = 110010 (6 bits), append 5 zeros to M(X):
• Step 2: Perform Binary Division
• Perform Modulo-2 division between 10100000 and 110010 (using XOR).
• Step 3: Get the Remainder (CRC Checksum)
• After division, the remainder is the CRC checksum.
• Step 4: Append CRC to the Message
• Attach the remainder to M(X) before transmission.
• Step 5: Receiver Checks for Errors
• The receiver performs the same division. If the remainder is zero, no error occurred.
Page
Compiled by Kalyani Pawar
14
Explain the process of CRC with respect to following example. If G (X) = 110010 and
M (X) = 101 then calculate CRC for above stream.(W-18) -4marks
Procedure:- data bits= G(X)=110010 divisor=M(X)=101
Here divisor is 3 bits so we need to append 2 zeroes (2 bit) to the data bits for
division.
Division carried is the normal binary division.
Result is calculated by the following condition:
1. If the remainder after division process is zero , it indicates that the data bits has
no errors and the data bit is acceptable
2. If the remainder after division is non-zero , it indicates that the data bits has
errors and we have to append the remainder bits to the original data bits and then
send the data again. This remainder bits
are called as the CRC. So the data bits transmitted will be DATA + CRC
Consider the given example, lets perform division process for CRC.
Here the divisor is 3 bits hence we append 2 zeroes to the data bits,so
the data bits will be 11001000 this will be divided by 101
Compiled by Kalyani Pawar
CRC Encoder
Page
Compiled by Kalyani Pawar
16
Thank You
Kalyani Pawar
Department of Information Technology(NBA Accredited)
Vidyalankar Polytechnic
Vidyalankar College Marg, Wadala(E), Mumbai 400 037
E-mail: [Link]@[Link]
Compiled by Kalyani Pawar 17
Any Questions
Compiled by Kalyani Pawar 18