All subjects · Computer Science · WCP03 Advanced Principles of Computer Science
Error detection: parity, block parity and checksums
Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science
Interference can flip bits during transmission. Error detection lets the receiver spot that data has been corrupted so it can ask for it again. You must be able to calculate parity bits, two-dimensional block parity and checksums.
Parity bits
A parity bit is added to each group of bits so the total number of 1s is even (even parity) or odd (odd parity), as agreed.
- Even parity: 1011001 has four 1s, so the parity bit is 0.
- Odd parity: the same data gets parity bit 1.
The receiver counts the 1s; the wrong parity means an error. Limits: it cannot detect an even number of flipped bits, and it cannot tell which bit is wrong. Benefit: very cheap, one extra bit.
Two-dimensional block parity
Data is arranged in a block of rows. A parity bit is added to each row and each column (the bottom row of column parity bits is the parity byte).
If one bit flips, exactly one row and one column show the wrong parity: their intersection locates the bit, so it can be corrected by flipping it back. It also detects many multi-bit errors. Drawback: more overhead, and some patterns (four errors at the corners of a rectangle) cancel out.
| Row | Data | Row parity (even) |
|---|---|---|
| 1 | 1011001 | 0 |
| 2 | 0110110 | 0 |
| 3 | 1110001 | 0 |
| 4 | 0001111 | 0 |
| Column parity | 0010001 | 0 |
Checksums
A checksum is a value calculated from a block of data and sent with it. The receiver repeats the calculation; a different result means an error.
A simple method: add the data values and keep the remainder after dividing by 256 (so it fits in one byte).
Example: 45 + 120 + 200 + 99 = 464; 464 mod 256 = 208.
Benefits: detects many multi-bit errors in a whole block with little overhead. Drawbacks: cannot locate the error; swapping two values or errors that cancel out (one value +1, another -1) are missed. Real protocols use stronger methods (one's complement sums in TCP/IP, cyclic redundancy checks in Ethernet).
After detection
Detection is usually paired with automatic repeat request (ARQ): the receiver sends an acknowledgement if the data is correct, or a negative acknowledgement (or no acknowledgement) so the sender retransmits.
Worked example
Calculate the checksum (sum mod 256) for the bytes 45, 120, 200, 99.
- Sum = 45 + 120 + 200 + 99 = 464
- 464 - 256 = 208
Answer: Checksum = 208
Check yourself
- What even parity bit is added to 1101011?
Show answer
1. 1101011 has five 1s; add 1 to make six.
- What odd parity bit is added to 0110110?
Show answer
1. 0110110 has four 1s; odd parity needs 1 to make five.
- Even parity is used, with the parity bit as the leftmost bit. Which byte has been received with an error?
- 11000000
- 01100110
- 10100100
- 00000000
Show answer
10100100. 10100100 has three 1s, an odd number, so even parity fails. The others have even counts.
- Why can a single parity bit fail to detect an error?
- It only checks the first bit
- If two bits flip, the number of 1s keeps the same parity
- It can only be used with odd parity
- It changes the data
Show answer
If two bits flip, the number of 1s keeps the same parity. An even number of errors leaves parity unchanged.
- Data rows 1011001, 0110110, 1110001, 0001111 are sent with even column parity. What is the parity bit for the first (leftmost) column?
Show answer
0. First column bits: 1, 0, 1, 0, which has 2 ones; even parity bit = 0.
- In two-dimensional block parity, how is a single flipped bit located?
- It is always in the parity byte
- It is where the row and the column with incorrect parity cross
- The checksum gives its position
- It cannot be located
Show answer
It is where the row and the column with incorrect parity cross. One bad row plus one bad column pinpoints the bit.
- Calculate the checksum (sum of values mod 256) for the bytes 90, 150, 77, 33.
Show answer
94. 90 + 150 + 77 + 33 = 350; mod 256 = 94.
- Which error would a simple additive checksum fail to detect?
- One value changed from 40 to 41
- One bit flipped in one byte
- Two data values arriving in swapped order
- A value lost completely
Show answer
Two data values arriving in swapped order. Addition gives the same total whatever the order.
Sources
- Pearson Edexcel International Advanced Subsidiary and Advanced Level in Computer Science specification (2026), Issue 1
- Pearson Edexcel IAL Computer Science sample assessment materials (Unit 3 paper, resource booklet and mark scheme)
Last updated 8 November 2026. Spotted a mistake? Tell us.