2.2 Error Detection Methods

Show All Section Notes

Error Detection Methods

1. The Parity Bit (Single Byte)

Before transmission, the sender checks the number of 1s in a byte. In Even Parity, the parity bit is set to ensure the total count of 1s is an even number.

Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Parity (P)
10110100

In the example above, there are four 1s. Since 4 is already even, the Parity Bit is 0.

2. The Parity Block (Horizontal & Vertical)

When a block of data is sent, a Parity Byte is added at the end. This byte enforces parity for every column, while the standard parity bit enforces it for every row.

B7B6B5B4B3B2B1P (Row)
Byte 110011010
Byte 211001011
Byte 301101100
Parity Byte00111100

How the error is found:
The receiver recalculates the row and column parities. In the table above, Row 2 fails the parity check (it has 4 ones, but the parity bit says it should be odd). Column B4 also fails. The intersection (the red cell) must be the incorrect bit. It is flipped from 0 back to 1.

3. Checksum: The Calculation

Checksums are used for blocks of data (packets). A common simple algorithm involves summing the bytes and using the remainder (Modulo).

Example Algorithm (Sum Modulo 256):
Suppose we send three bytes: 15, 20, 10.

1 Sum the values: $15 + 20 + 10 = 45$
2 Perform Modulo 256: $45 \div 256 = 0 \text{ remainder } 45$
3 The Checksum is 45. This value is sent with the packet.

Application: TCP/IP Packets, File Downloads (.iso, .exe)

4. Check Digit: The Calculation

Check digits are the final digit in a code, calculated using an algorithm like Modulo-11 or ISBN-10.

Example: ISBN-10 (Weighted Sum)
Number to check: 0-306-40615-?

1 Assign Weights: Multiply each digit by its position (10 down to 2).
$(0\times10) + (3\times9) + (0\times8) + (6\times7) + (4\times6) + (0\times5) + (6\times4) + (1\times3) + (5\times2)$
$0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 = 130$

2 Find Remainder: $130 \div 11 = 11 \text{ remainder } 9$

3 Subtract from 11: $11 - 9 = 2$
The Check Digit is 2. The full number is 0-306-40615-2.

Application: Barcodes (EAN/UPC), ISBNs, Vehicle Identification Numbers (VIN)
Summary for Exam:
  • Parity Block: Detects and corrects single-bit errors.
  • Checksum: Used by computers for data transmitted over networks.
  • Check Digit: Used to catch human entry errors (swapping digits).