A checksum is used to verify data integrity during file transfer. (a) Explain how a checksum is calculated and used to detect errors. [3] (b) A simple check...

Assessment: Computer Science (9-1) 0984 | Paper 2 Mock 01 | Algorithms, Programming and Logic Subject: Computer Science (9-1) - 0984

Question 1 Report

A checksum is used to verify data integrity during file transfer.

(a) Explain how a checksum is calculated and used to detect errors. [3]

(b) A simple checksum is calculated by adding all the byte values and taking the last 8 bits (modulo 256). Calculate the checksum for the following data bytes: [3]

Byte12345
Value451207820033

(c) The receiver calculates a checksum of 221 but the sender's checksum was 220. State what the receiver should do. [2]

(d) State one advantage and one disadvantage of using checksums compared to parity checks. [2]

(e) Describe two methods of error detection used in data transmission. [2]

(f) Explain the difference between serial and parallel data transmission. State one advantage of each. [3]

(g) Calculate the parity bit needed for each of the following bytes using even parity: 1010110 and 0110011. [1]

Answer Details

(a) How a checksum works: [3]

A checksum is calculated by performing a mathematical operation (typically addition) on all the data values in a block being transmitted. [1] The resulting checksum value is sent alongside the data to the receiver. [1] The receiver performs the same calculation on the received data and compares the result with the transmitted checksum. If the values match, the data is assumed intact. If they differ, an error has occurred and the data must be retransmitted. [1]

(b) Calculating the checksum for bytes [45, 120, 78, 200, 33]: [3]

Sum = 45 + 120 + 78 + 200 + 33 = 476 [1]

476 MOD 256 = 476 - 256 = 220 [1]

Checksum = 220 [1]

The MOD 256 operation keeps the checksum within 8 bits (0-255), since a single byte can only hold values in that range.

(c) What the receiver should do when checksums do not match (221 vs 220): [2]

The mismatch indicates that the data was corrupted during transmission. [1] The receiver should request that the sender retransmit the data. This mechanism is called Automatic Repeat Request (ARQ). [1]

(d) Advantage and disadvantage of checksums vs parity checks: [2]

Advantage: A checksum can detect a wider range of errors than a simple parity check because it considers the actual values of all bytes, not just the count of 1-bits. [1]

Disadvantage: A checksum cannot identify which specific byte contains the error. When an error is detected, the entire data block must be retransmitted. Also, checksums can miss errors where changes cancel each other out (e.g. one byte increases by 1 and another decreases by 1). [1]

(e) Two methods of error detection: [2]

Parity check: An extra parity bit is added to each byte to make the total number of 1-bits either even (even parity) or odd (odd parity). If a single bit is flipped during transmission, the parity will be wrong and the error is detected. [1]

Checksum: All data values in a block are summed and the total is sent alongside the data. The receiver recalculates the sum and compares it to verify data integrity. [1]

(f) Serial vs parallel data transmission: [3]

Serial transmission sends data bits one at a time along a single data line. [1]

Parallel transmission sends multiple bits simultaneously along several data lines (e.g. 8 lines for a byte at a time). [1]

Serial advantage: more reliable over long distances because there is no timing skew between bits (all bits travel the same wire). Parallel advantage: faster over short distances because multiple bits are sent simultaneously. [1]

(g) Parity bits for even parity: [1]

  • 1010110: contains four 1s (even), so parity bit = 0
  • 0110011: contains four 1s (even), so parity bit = 0

Even parity means the total number of 1s (including the parity bit) must be even. Since both bytes already have an even number of 1s, the parity bit is 0 in both cases.

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning