Describe parity check (odd and even), checksum and echo check

Methods of Error Detection

Learning Objective

Explain how each of the following techniques detects errors that may occur after data has been transmitted over a communication link, and state the limitations of each method:

  • Parity check (odd and even)
  • Checksum
  • Echo check (loop‑back test)

1. Why Errors Can Occur

During transmission data travel through cables, wireless media or satellite links. Electrical noise, electromagnetic interference, attenuation, or faulty hardware can change one or more bits of the binary data. Because the receiver cannot see the physical cause, it must use an error‑detection method to verify that the received data matches the data that was sent.

1.1 Packet structure (relevant to the syllabus)

A typical data packet (or frame) consists of three fields:

Field Purpose
Header Control information (start‑of‑frame, address, etc.)
Data field The actual information to be transferred
Error‑checking field Parity bit, checksum, or other error‑detection data
Diagram of a packet – the error‑checking field (highlighted) holds the parity bit, checksum or echo‑check data.
Header Data field Error‑checking field

2. Parity Check (odd & even)

2.1 What is a parity bit?

A parity bit is a single extra bit added to a binary word so that the total number of 1 bits (including the parity bit) is either even (even parity) or odd (odd parity).

2.2 Generating the parity bit – step‑by‑step

  1. Count the number of 1 bits in the data word.
  2. Even parity:
    • If the count is even, set the parity bit to 0.
    • If the count is odd, set the parity bit to 1.
  3. Odd parity:
    • If the count is odd, set the parity bit to 0.
    • If the count is even, set the parity bit to 1.
  4. Append the parity bit to the data word (usually at the end) and transmit the packet.

2.3 Verifying parity at the receiver

  1. Receive the data word together with its parity bit.
  2. Re‑count the 1 bits, including the received parity bit.
  3. If the total matches the expected parity (even or odd), accept the data; otherwise flag an error.

2.4 Worked example

Data word: 1011001 (four 1s)

  • Even parity – count already even → parity bit = 0 → transmitted 10110010
  • Odd parity – count even, need odd total → parity bit = 1 → transmitted 10110011

2.5 Limitations (explicit wording from the syllabus)

  • Detects any single‑bit error (flipping one bit changes the parity).
  • Fails to detect errors that affect an even number of bits (the overall parity remains unchanged).
  • Provides no information about which bit is wrong.

3. Checksum

3.1 What is a checksum?

A checksum is a multi‑bit error‑checking field (commonly 8‑bit or 16‑bit) calculated from the data words in a packet using one’s‑complement binary addition. The final sum is then inverted (one’s complement) to produce the checksum.

3.2 Calculation procedure (one’s‑complement addition)

  1. Divide the data field into equal‑size words (e.g., 8‑bit words).
  2. Add the words using binary addition.
  3. If a carry is produced beyond the most‑significant bit, wrap it around and add it to the least‑significant bit (ignore overflow).
  4. Take the one’s complement (invert every bit) of the final sum – this is the checksum.
  5. Append the checksum to the packet and transmit.

3.3 Worked example (8‑bit checksum)

Data words:

  • A = 11010101
  • B = 01100110
  • C = 10111001

Step 1 – Add A and B

  11010101
+ 01100110
------------
1 001111011   (9‑bit result)

Carry out of the 8‑bit position = 1. Wrap it around:

  00111101   (drop the leftmost 1)
+        1
------------
  00111110

Step 2 – Add C

  00111110
+ 10111001
------------
  11110111

Step 3 – One’s complement

Checksum = 00001000

The sender transmits A, B, C and the checksum 00001000.

3.4 Verification at the receiver

  1. Add all received words **including** the checksum using the same one’s‑complement method.
  2. If the final sum is a word of all 1s (e.g., 11111111 for an 8‑bit checksum), the packet is assumed to be error‑free.
  3. Any other result indicates that an error has occurred.

3.5 Limitations (syllabus wording)

  • Detects all single‑bit errors.
  • Detects many multi‑bit errors, especially when the erroneous bits are in different words.
  • May fail to detect cancelling errors – for example, two bits of equal weight are flipped in opposite directions, producing the same sum.
  • Does not indicate the position of the error.

4. Echo Check (Loop‑Back Test)

4.1 Definition and purpose

The echo check, also called a loop‑back test, is a diagnostic technique in which a data block is sent to a remote system that immediately returns (echoes) the exact same block. By comparing the returned block with the original, the sender can confirm whether the transmission path (both forward and return) is operating correctly.

4.2 Procedure (step‑by‑step)

  1. Sender transmits a data frame D to the remote device.
  2. The remote device receives D and sends it back unchanged as D′.
  3. Sender receives D′ and compares it bit‑by‑bit with the original D.
  4. If D′ = D, the link is considered error‑free; otherwise an error is flagged.

4.3 Numeric example

Assume the sender transmits the byte 10101010.

  • Case 1 – No error: Remote device echoes 10101010. Comparison shows identical bits → link OK.
  • Case 2 – Error on forward path: The byte arrives at the remote device as 10111010 (bit 4 flipped). The remote device echoes this corrupted byte. The sender receives 10111010 and detects a mismatch → error flagged.
  • Case 3 – Error on both paths, same pattern: Forward path flips bit 4, return path flips the same bit back to the original value. The sender receives 10101010 and sees no difference → the error is not detected (a known limitation).

4.4 Typical uses

  • Testing serial ports, network cables, or wireless links during installation or maintenance.
  • Verifying that hardware (modems, NICs) and software drivers correctly handle data.
  • Providing a quick, low‑overhead integrity check where no extra error‑detecting bits are required.

4.5 Limitations (syllabus wording)

  • Detects any error that changes the echoed frame, but does not pinpoint the erroneous bit.
  • Requires a responsive remote system capable of echoing the data.
  • Fails to detect errors that occur on both the forward and return paths in exactly the same way.

5. Summary Table (matches syllabus wording)

Method How it works (key idea) What it detects Limitations (what it may miss)
Parity check (odd and even) Add a single parity bit so the total number of 1s is even or odd. All single‑bit errors. Fails to detect errors that affect an even number of bits.
Checksum One’s‑complement addition of data words; the complement of the sum is sent as the checksum. All single‑bit errors and many multi‑bit errors. May miss cancelling errors where two bits of equal weight are flipped in opposite directions.
Echo check (loop‑back test) Send a frame, have the remote system return the identical frame, then compare. Any error that changes the echoed frame. Does not locate the error; fails if the same error occurs on both forward and return paths.

6. Final Summary

  • Data can become corrupted during transmission because of noise, interference, or hardware faults.
  • Parity, checksum, and echo check are three distinct techniques required by the Cambridge IGCSE 0478 syllabus.
  • Each method balances simplicity, error‑detection capability, and resource requirements; the choice depends on the application and the type of errors that are most likely.

Create an account or Login to take a Quiz

49 views
0 improvement suggestions

Log in to suggest improvements to this note.