0% found this document useful (0 votes)
95 views3 pages

Cyclic Redundancy Check Program in C - CRC

Uploaded by

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

Cyclic Redundancy Check Program in C - CRC

Uploaded by

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

27/10/2024, 11:38 Cyclic Redundancy Check program in C | CRC

https://onlinesmarttrainer.blogspot.com/2021/02/cyclic-redundancy-check.html 1/3
27/10/2024, 11:38 Cyclic Redundancy Check program in C | CRC

Cyclic Redundancy Check program in C | CRC

Write a program to compute CRC code for the polynomials CRC-12, CRC-16 and CRC
CCIP

Name of Experiment: Cyclic Redundancy Check

Hardware Requirements: Intel based Desktop PC:RAM of 1GB

Software Requirement: Turbo C / Turbo C++

Theory:

Cyclic Redundancy Checks fall into the same category as parity bits, check digits, and checksums: Their
use is to detect transmission errors. Depending on the error model assumed (i.e., what types of
transmission errors are to be expected, which typically depends on the transmission media), different forms
of checking are appropriate.

This technique involves binary division of the data bits being sent. The divisor is generated using
polynomials. The sender performs a division operation on the bits being sent and calculates the remainder.
Before sending the actual bits, the sender adds the remainder at the end of the actual bits. Actual data bits
plus the remainder is called a codeword. The sender transmits data bits as code-words. At the other end,
the receiver performs division operation on code-words using the same CRC divisor. If the remainder
contains all zeros the data bits are accepted, otherwise it is considered as there some data corruption
occurred in transit.

SOURCE CODE:

// Program for Cyclic Redundancy Check

#include<stdio.h>

int gen[4],genl, frl, rem[4];

void main ( )

int i,j,fr[8],dupfr[11],recfr[11],tlen,flag;

frl=8; genl=4;

printf ("Enter frame:\n");

for (i=0; i<frl; i++)

scanf ("%d", &fr[i]);

dupfr[i]=fr[i];

printf("Enter generator:\n");

for (i=0; i<genl;i++)

scanf ("%d", &gen[i]);

tlen=frl+genl-1;

for(i=frl;i<tlen;i++)

dupfr[i] =0;

remainder(dupfr);

for (i=0; i<frl; i++)

recfr[i]=fr[i];

for(i=frl,j=1;j<genl;i++,j++)

recfr[i]=rem[j];

remainder(recfr);

flag=0;

for(i=0;i<4;i++)

if(rem[i]!=0)

flag++;

if (flag==0)

printf ("Frame is received correctly\n");

else

printf ("The received frame is wrong\n");

remainder (int fr[])

int k,k1,i,j;

for(k=0;k<frl;k++)

if (fr[k]==1)

k1=k;

for (i=0,j=k;i<genl;i++,j++)

rem[i]=fr[j]^gen[i];

for(i=0;i<genl;i++)

fr[k1]=rem[i];

k1++;

return 0;

OUTPUT CONSOLE:

CRC

https://onlinesmarttrainer.blogspot.com/2021/02/cyclic-redundancy-check.html 2/3
27/10/2024, 11:38 Cyclic Redundancy Check program in C | CRC

herymeelon April 27, 2021 at 11:28 AM

Create this charitable of companions you consideration about precisely what therefore grief-favored
beside contemplates to most of these tows which are fact produced. IR Repeater

REPLY

To leave a comment, click the button below to sign in with Google.

SIGN IN WITH GOOGLE

NEW

Search related post on google

2020 © copyright | Developed by Abdul Rais | All Rights Reserved

Labels

Total Page Views


741,989

YouTube Video
Introduction to Automata Theory
Basic Concepts of Automata
Kleene Closure and Postive Closure
Strassen's Matrix Multiplication

https://onlinesmarttrainer.blogspot.com/2021/02/cyclic-redundancy-check.html 3/3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy