# Q4(b) · Internet checksum

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/papers/paper-2024-ai-final/q4b

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/papers/paper-2024-ai-final--q4b/

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

### Q4(b). Find the 8-bit checksum of 10110001, 10101011, 00110101, 10100001. [5 marks]

### Answer

### Given

10110001, 10101011, 00110101, 10100001; 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)
$$



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

| Word | Decimal | Raw addition | Folded addition | Running binary sum |
| --- | --- | --- | --- | --- |
| 10110001 | 177 | 177 | 177 + carry 0 = 177 | 10110001 |
| 10101011 | 171 | 348 | 92 + carry 1 = 93 | 01011101 |
| 00110101 | 53 | 146 | 146 + carry 0 = 146 | 10010010 |
| 10100001 | 161 | 307 | 51 + carry 1 = 52 | 00110100 |

### Step 2. Complement every bit

Running sum = 00110100. Change every 0 to 1 and every 1 to 0: **checksum = 11001011** (decimal 203).

### Step 3. Receiver adds the data and checksum

52 + 203 = 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.
