0% found this document useful (0 votes)
86 views3 pages

Checksum Method Example

Uploaded by

Kennedy Muthoni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views3 pages

Checksum Method Example

Uploaded by

Kennedy Muthoni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sure!

Let's walk through an example of the Checksum error detection method, which is
another simple error-detection technique used in communication systems.

Overview of the Checksum Method:

In the Checksum method, data is divided into fixed-sized blocks (usually bytes or words), and
each block's sum is calculated. This sum is then stored as the checksum. When the data is
received, the checksum is recalculated and compared to the stored checksum. If they match, the
data is assumed to be correct; if not, an error is detected.

Example: Let's say we are using 8-bit checksum (common for small systems or
basic protocols).

Step-by-Step Process:

1. Original Data (Message): Let’s say the original data (message) is:
2. 11011001 10101010 01101101

This is the data that needs to be transmitted. For simplicity, we're using 8-bit words (1
byte each).

3. Step 1: Divide Data into 8-bit Chunks: Split the message into individual 8-bit chunks:
4. 11011001 (217 in decimal)
5. 10101010 (170 in decimal)
6. 01101101 (109 in decimal)
7. Step 2: Calculate the Sum: Add these 8-bit chunks together. We will do it in binary and
keep in mind that in checksum calculations, we wrap around any overflow (this is called
one’s complement addition).
o First, add 11011001 and 10101010:
o 11011001 (217)
o 10101010 (170)
101010011 (387 in decimal)

Since we're working with 8-bit numbers, we discard the leftmost


bit (overflow) and keep the rightmost 8 bits, which gives us:

01010011 (19 in decimal) `

o Now, add 01010011 (19) to 01101101 (109):


o 01010011 (19)
o 01101101 (109)
10111100 (128 in decimal)

8. So, the sum of the 8-bit chunks is 10111100 (128 in decimal).


9. Step 3: Compute thZe One’s Complement: The checksum is the one’s complement of
the sum. To compute the one’s complement, you flip every bit (change 1's to 0's and 0's
to 1's).
10. Sum: 10111100
11. One’s Complement (Checksum): 01000011

So, the checksum for this data is 01000011 (67 in decimal).

12. Step 4: Transmit Data: The message is now sent along with the checksum. The
transmitted data will be:
13. Data: 11011001 10101010 01101101
14. Checksum: 01000011
15. Step 5: Receive Data and Recalculate the Checksum: On the receiver’s end, the data
will be received along with the checksum. The receiver performs the same process:
o Add the received 8-bit chunks.
o Add the checksum.
o If the result is all 1's (i.e., the sum of the data and checksum is 11111111), then
the data is assumed to be correct. Otherwise, an error is detected.

In this case, the receiver will add:

11011001 + 10101010 + 01101101 + 01000011 = 11111111

Since the result is all 1's, the receiver knows that no error has occurred.

Example with an Error:

Let’s say there was an error during transmission, and one bit of data changed. Suppose the
received data is:

11011001 10101001 01101101 01000011

Notice that the second byte has changed from 10101010 to 10101001. Let’s go through the
checksum verification process again:

1. Add the received 8-bit chunks:


2. 11011001 (217)

 10101001 (169)
101000010 (386 in decimal) → wrap around and keep the last 8 bits: 01000010

Now, add `01000010` (66) and `01101101` (109):

01000010 (66)
 01101101 (109)
10101111 (175 in decimal)

Finally, add the checksum:

10101111 (175)

 01000011 (67)
11110010 (242 in decimal)

Since the sum is **not** all 1's (`11111111`), the receiver knows that
there was an error in transmission.

Summary of the Checksum Method:

1. Sender Side:
o The sender calculates the sum of the data chunks (typically using one's
complement).
o The checksum is calculated as the one's complement of the sum and sent along
with the data.
2. Receiver Side:
o The receiver recalculates the sum of the received data and the checksum.
o If the result is all 1's, the data is considered error-free. If not, an error is detected.

This method is simple and effective for detecting errors in data transmission, but it's not as robust
as methods like CRC, as it is more susceptible to certain types of errors (such as errors that
cancel each other out).

You might also like