0% found this document useful (0 votes)
128 views20 pages

Cyclic Redundancy Code

Cyclic Redundancy Code (CRC) is an error detection technique used widely in computer networks. It works by using a generator polynomial to produce a checksum value appended to data during transmission. The receiver divides the received data and checksum by the same generator; if the remainder is non-zero, an error is detected. CRC allows devices to detect if data has been altered during network transmission and take corrective actions like requesting retransmission.

Uploaded by

sumit kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views20 pages

Cyclic Redundancy Code

Cyclic Redundancy Code (CRC) is an error detection technique used widely in computer networks. It works by using a generator polynomial to produce a checksum value appended to data during transmission. The receiver divides the received data and checksum by the same generator; if the remainder is non-zero, an error is detected. CRC allows devices to detect if data has been altered during network transmission and take corrective actions like requesting retransmission.

Uploaded by

sumit kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Cyclic Redundancy Code

Cyclic Redundancy Check

• Cyclic Redundancy Check (CRC) is an error detection technique to


detect changes to raw data and is used widely in today’s computer
networks.
• CRC codes are also known as polynomial codes, since it is possible to
view the bit string to be sent as a polynomial.
Why CRC?
CRCs are so called because the check (data verification)
value is a redundancy (it expands the message without
adding information and the algorithm is based on cyclic
 codes.
Application
• When a codeword is received or read, a CRC-enabled device performs
a CRC on the whole codeword and compares the resulting check value
with an expected residue constant.
• If the CRC check values do not match, then the block contains a data
error
• The device may take corrective action, such as rereading the block or
requesting that it be sent again.
Generator
• The sender and receiver must first agree on an pattern, known as a
generator, which we will denote as G.
• If the generator is a polynomial, it must follow the following two
properties:
• It should not be divisible by x , because otherwise the last bit of the
checksum would always be 0.
• It should be divisible by x
• The Technique Suppose m is the number of bits of the CRC generator.
On Sender Side
Step 1
• Append (m-1) number of zeroes to the data on the Least Significant Bit (LSB)
(rightmost) side.
• Divide it by the CRC Generator. (XOR operation is performed instead of
Subtraction while dividing)
Step 2
• The remainder from this division is added to the data generated earlier
in Step 1.
• This data is then sent to the destination
On Receiver Side
Step 1
• Received data is again divided by the CRC generator.
Step 2
• If remainder is zero No Error in Data
• If remainder is not zero Data was altered somewhere in the network.
Example In this example, we shall encode 14 bits of message.
• Generator is the polynomial x3 + x + 1.
• The polynomial is written in binary as the coefficients (1x3 + 0x2 + 1x +
1).
• In this case, the coefficients are 1, 0, 1 and 1.
• Generator = 1011
Transmission side :
data word to be sent -100100
key – 1101 [or generator polynomial

Therefore, the remainder is 001 and hence the encoded data


Sent is 100100001 .
Receiver side :
code word received at the receiver side is
100100001

Therefore the remainder is all zero’s


hence the data received has no errors.
Now for instance if fourth bit from LSB was accidentally altered
• Now for instance if fourth bit from LSB was accidentally altered. The
receiver can easily detect that error by dividing the received data by
the generator. The remainder now comes out to be 1 which is not
equal to 0
• Now that it is established that the received data has error The device
may take corrective action, such as rereading the block or requesting
that it be sent again.
• CRC is evaluated during transmission and appended to the output
stream as soon as the last bit goes out onto the physical medium.
• It is better to have the CRC in a trailer. Because then we can compute
the CRC as you transmit the packet.
• The CRC is computed while the packet is being transmitted and then
incorporated in a trailer. Similarly, the receiver computes the CRC and
compares it with the transmitted one.
• If we put it in the header, we would have to make several passes in
order to compute the CRC and then actually stuffing each byte.
If generator is x3 + 1 and message to be sent is “CAT”
• If generator is x3 + 1 and message to be sent is “CAT” . Find What Data
is Sent. Further if 5th Bit is Changed show that the error can be
detected.
C- 1000011
A- 100001
T- 1010100
• Generator = 1001
• Append Three Zeroes
• Solve with the same steps
Algorithm of the CRC
CRC in the SoC verification

• Step 1: Create C code in firmware/program.


• Step 2: then go to the firmware directory and run make command which creates
objdump, elf, hex files.
Make TEST = name_of_the _programme SPIKE_RUN =0 // we use the spike
run 0 when running on the core.
• Step 3: go to the functional verification folder and create the .svh file, in the same
folder find mail_env.svh and add code here and create a mailbox handle.
• Step 4: Inside mailbox_pkg.svh include the C code file.
• Step 5: In the sim folder run perl command
• Step 6: launch simvision
• Step 7: In the simvision tool open their waveforms and check their respective
signals

You might also like