Lab 4
Lab 4
OBJECTIVE: The goal of this lab is to understand and implement Cyclic Redundancy Check
(CRC), a popular error-detection technique used in communication systems, using a programming
language. It will help to understand and learn, how CRC is computed and how it helps in detecting
errors in transmitted messages.
Task:
1. Write a program that takes an input binary message and a generator (binary string).
Background:
Cyclic Redundancy Check (CRC) is a technique used to detect errors in data transmission. It
involves dividing the input data by a known generator, then appending the remainder (CRC code)
to the message. At the receiving end, the same polynomial is used to check if the message is error-
free.
Key concepts:
• Modulo-2 Division: The process of dividing the data by the generator to compute the
remainder (CRC code).
• Remainder: The computed CRC, which is appended to the original data.
Lab Steps:
Step 1: Input Data and Polynomial
• Implement an XOR operation between two binary strings. This will be used in the
division process.
• Perform Modulo-2 Division to compute the CRC code (remainder). The steps are similar
to long division, but operations are performed modulo 2 (without carry).
• After computing the CRC code, append it to the original message. This encoded data will
be transmitted to the receiver.
• Simulate a scenario where the receiver gets the transmitted message, and perform the
division again to check for errors.
• If the remainder is all zeros, the message is error-free. If not, an error has been detected.