Computer Networks · TEE · papers

Q5(c) · 8-bit checksum

2024-02-06 · AI-only Sem V variant

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

Q5(c). For data 10101001 00111001, show sender and receiver steps for an 8-bit checksum. [5 marks]

Answer

Given

10101001, 00111001; word width = 8 bits.

To find

Sender checksum and receiver verification.

Formula and why

S=\operatorname{endAroundCarry}(\text{sum of words}),\qquad C=\operatorname{NOT}(S)LaTeX: S=\operatorname{endAroundCarry}(\text{sum of words}),\qquad C=\operatorname{NOT}(S)

One’s-complement addition returns an overflow carry to the least-significant end. Complement only after all words have been added.

Solution

Step 1. Add the words, folding each carry

WordDecimalRaw additionFolded additionRunning binary sum
10101001169169169 + carry 0 = 16910101001
0011100157226226 + carry 0 = 22611100010

Step 2. Complement every bit

Running sum = 11100010. Change every 0 to 1 and every 1 to 0: checksum = 00011101 (decimal 29).

Step 3. Receiver adds the data and checksum

226 + 29 = 255 = 11111111. All bits are 1; complement gives all zeros. Therefore this intact message passes the checksum check. A matching checksum detects no error; it does not prove that every possible corruption is absent.