Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to implement the checksum method. The implementation has two parts a. Calculating the checksum at the sender b. Verifying the checksum at
Write a program to implement the checksum method. The implementation has two parts a. Calculating the checksum at the sender b. Verifying the checksum at the receiver cks Inputs: 4 data each consisting of 16-bit (binary) Output: Checksum of 16-bit (binary) Example: http://mathforum.org/library/drmath view/54379 html For example, suppose we have the following data. I separate the data into groups of 4 bits only for readability. 1000 0110 0101 1110 1010 1100 0110 0000 0111 0001 0010 1010 1000 0001 1011 0101 First, we add the 16-bit values 2 at a time: 1000 0110 0101 1110 First 16-bit value +1010 1100 0110 0000 Second 16-bit value 1 0011 0010 1011 1110 Produced a carry-out, which gets added +1----back into LSb + 0111 0001 0010 1010 Third 16-bit value + 1000 0001 1011 0101 Fourth 16-bit value 1 0010 0101 1001 1110 Produced a carry-out, which gets added +1--- back into LSb Note that we could "swing around" the carry-out of 0, but adding 0 back into the LSb has no effect on the sum. (But technically, that's what the checksum generator does Then we have to take the one's complement of the sum. We do this by simply inverting all the bits in the final result from above: 1101 1010 0110 0000 The "one's complement" Therefore, the checksum generated from the given data would be 1101 1010 0110 0000 Inputs: 4 data each is consisting of 16-bit and their 16-bit checksum Output: Checksum for 4 data each is consisting of 16-bit and their 16-bit checksum If checksum is equal to Os, your data is not corrupted If checksum is not equal Os, your data is corrupted
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started