2.
Write a Program to compute CRC code
Cyclic Redundancy Check (CRC) An error detection mechanism in which a special
number is appended to a block of data in order to detect any changes introduced
during storage (or transmission)
The various steps followed in the CRC method are
1. A string of n as is appended to the data unit. The length of predetermined divisor
is n+ 1.
2. The newly formed data unit i.e. original data + string of n as are divided by the
divisor using binary division and remainder is obtained. This remainder is called
CRC.
3. Now, string of n Os appended to data unit is replaced by the CRC remainder
(which is also of n bit).
4. The data unit + CRC is then transmitted to receiver.
5. The receiver on receiving it divides data unit + CRC by the same divisor & checks
the remainder.
6. If the remainder of division is zero, receiver assumes that there is no error in data
and it accepts it.
7. If remainder is non-zero then there is an error in data and receiver rejects it.
EXAMPLE