Parity Bits and Checksums Explained

Why Transmitted Data Needs Error Checking at All

Electrical noise, interference, and imperfect hardware can all flip a bit during transmission - turning a 0 into a 1, or vice versa. Error detection techniques let a receiver notice when this has happened, even without knowing exactly which bit was affected.

Parity Bits: The Simplest Approach

A parity bit is one extra bit added to a group of data bits, set so that the total count of 1-bits (including the parity bit itself) is always even (even parity) or always odd (odd parity), by agreement.

Data: 1 0 1 1 0 0 1   (four 1-bits - already even)
Even parity bit added: 0   ->  final: 1 0 1 1 0 0 1 0

If one bit flips during transmission, the total count of 1s becomes odd,
and the receiver immediately knows an error occurred.

A Key Limitation of Simple Parity

A single parity bit can only reliably detect an odd number of flipped bits (1, 3, 5...). If exactly two bits flip at the same time, the total count of 1s returns to matching the expected parity, and the error goes completely undetected.

Checksums: A Stronger Alternative

A checksum treats a larger block of data as a sequence of numbers, adds them together using a defined arithmetic method, and sends the result alongside the data. The receiver repeats the same calculation and compares its result to the sent checksum - a mismatch means something was altered in transit.

Why Even Checksums Aren't Foolproof

Both parity bits and simple checksums can, in rare cases, fail to detect certain specific patterns of errors - which is exactly why CRC, covered in the next note, was developed as a much stronger detection method for real-world networking.

Written by Lorens Mishra

Software Engineer Notes Management System Administrator

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.