CIE AS & A Level Computer Science, section 6.2 (Data integrity)
What verification is
Verification checks that data has been copied or entered correctly, matching the original or the data sent. It guards against mistakes during entry or transfer.
During data entry
- Visual check: the user reads the data on the screen and compares it with the original. Simple, but people miss errors.
- Double entry: the data is typed twice, (often by two people), and the computer compares the two entries. A difference shows an error.
During data transfer
- Parity check: an extra parity bit is added so that the number of 1s is even (even parity) or odd (odd parity). If the received number of 1s has the wrong parity, an error has occurred.
- Data has four 1s, so with even parity the parity bit is . Data has five 1s, so the parity bit is .
- Parity block check: parity is added to rows and columns of a block of data, which can find which bit is wrong.
- Checksum: a value calculated from the data (such as the sum of the bytes, modulo 256) is sent with it. The receiver recalculates it and compares.
Limits of verification
A parity check detects an odd number of changed bits, but misses two bits changing at once. Verification shows the data matches, not that it is correct in the first place.
Validation and verification together
Validation checks data is sensible; verification checks it was copied accurately. Both are needed.
Common mistake: mixing up validation and verification. Validation checks the data is sensible; verification checks it was entered or transferred correctly. Also, parity detects an odd number of bit errors, but can miss an even number.
Exam tip: for parity, state even or odd, count the 1s, and give the value of the parity bit. For double entry, say that the two entries are compared by the computer.
Check yourself
What is the even parity bit for 1100101?
There are four 1s, so the parity bit is .
What does double entry verify?
That the data was typed correctly: the two entries are compared and a difference signals an error.
What is a checksum?
A value calculated from the data and sent with it, so the receiver can recalculate and compare to detect errors in transfer.