/*
written by: Bibhakar Jha;
objective : to implement CRC in C Programming language;
*/
//Program code to add CRC check bit
#include
#include
#define N strlen(g)
char t[28],cs[28],g[]="10001000000100001";
int a,e,c;
void xor()
{
for(c = 1;c < N; c++)
cs[c] = (( cs[c] == g[c])?'0':'1');
}
void crc()
{
for(e=0;e
cs[e]=t[e];
do{
if(cs[0]=='1')
xor();
for(c=0;c
cs[c]=cs[c+1];
cs[c]=t[e++];
}while(e<=a+N-1);
}
int main()
{
clrscr();
printf("\nEnter data : ");
scanf("%s",t);
printf("\n----------------------------------------");
printf("\nGeneratng polynomial : %s",g);
a=strlen(t);
t[e]='0';
printf("\n----------------------------------------");
printf("\nModified data is : %s",t);
printf("\n----------------------------------------");
crc();
printf("\nChecksum is : %s",cs);
t[e]=cs[e-a];
printf("\n----------------------------------------");
printf("\nFinal codeword is : %s",t);
printf("\n----------------------------------------");
printf("\nTest error detection 0(yes) 1(no)? : ");
scanf("%d",&e);
if(e==0)
{
do{
printf("\nEnter the position where error is to be inserted : ");
scanf("%d",&e);
}while(e==0 e>a+N-1);
t[e-1]=(t[e-1]=='0')?'1':'0';
printf("\n----------------------------------------");
printf("\nErroneous data : %s\n",t);
}
crc();
for(e=0;(e
if(e
printf("\nError detected\n\n");
else
printf("\nNo error detected\n\n");
printf("\n----------------------------------------\n");
getch();
return 0;
}
write a c program to accept a number and generate a square root cube and exponential values
string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);
Yes, I can.
write a c program to display marks,total,average,grade using union
Without knowing the contents of the TippingBucketData.txt file nor how to process it, it would be impossible to say how such a program would be written.
Bushfire CRC was created in 2003.
Poultry CRC was created in 2003.
CRC Press was created in 1973.
No, that's what the compiler does.
CRC: Cyclical Redundancy CheckA term CRC is used in datalink protocols often used in transmission ..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. From both points of view, it is better to have the CRC in a trailer
You will need to have a little bit of computer science knowledge. This will help you to make the programing.
CRC Churches International was created in 1945.