Program the CRC 12 on a data set of characters
#1

Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int loop,loop1,loop2,temp,temp1,flen;
char frame[100]={'0'};
char comp[17]={'0'};
char quat[17]={'0'};
char generator[17]={'1','1','0','0','0','0','0','0','1','0','1'};
clrscr();
printf(" enter the frame:\n\t");
for(loop=0;loop<88;loop++)
{
frame[loop]=getch();
temp=frame[loop];
if(temp!=13&&temp!=48&&temp!=49)
{
loop--;
continue;
}
putch(frame[loop]);
if(frame[loop]==13)
break;
}
flen=loop;
for(loop=0;loop<13;loop++)
{
if(loop<flen)
comp[loop]=frame[loop];
else
comp[loop]='0';
}
temp=loop;
for(loop1=0;loop1<flen;loop1++)
{
if (comp[0]=='0')
{
for(loop2=0;loop2<11;loop2++)
comp[loop2]=frame[loop2+1];
if(temp<=flen)
comp[loop2]=frame[temp++];
else
comp[loop2]='0';
quat[loop1]='0';
continue;
}
else
quat[loop1]='1';
if(loop1!=0)


{
if(temp<=flen)
comp[12]=frame[temp++];
else
comp[12]='0';
}
for(loop=1;loop<13;loop++)
{
if(comp[loop]=='1'&&generator[loop]=='1')
comp[loop-1]='0';
else if(comp[loop]=='0'&&generator[loop]=='0')
comp[loop-1]='0';
else
comp[loop-1]='1';
}
comp[12]='\0';
}
quat[loop1]='\0';
printf("\n\n component= %s",comp);
printf("\n quant = %s",quat);
printf("\n generator= %s", generator);
for(loop=0;loop<12;loop++)
frame[flen+loop]=comp[loop];
frame[flen=loop]='\0';
printf("\n CRC: %s",frame);
getch();      }
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: matlab code for cursive characters recognition, warren leight nine ten characters, unicode characters, anthropomorphic animal characters, top 10 weirdest zelda characters, crc army defensive driving, top ten best marvel characters,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  VHDL program for Booth’s Multiplier smart paper boy 2 5,655 20-04-2013, 11:59 AM
Last Post: T
  Program in “LEX” to count number of vowels and consonants seminar class 2 9,629 22-03-2013, 10:20 AM
Last Post: computer topic
  Program in “LEX” to count number of Identifiers and Keywords seminar class 1 4,850 28-01-2013, 03:21 PM
Last Post: Guest
  PROGRAM TO RECOGNIZE A STRING WITH THREE COSECUTIVE 0’s smart paper boy 0 1,667 10-08-2011, 11:44 AM
Last Post: smart paper boy
  : PROGRAM TO IDENTIFY VOWELS AND CONSONANTS GIVEN AS INPUT smart paper boy 0 2,408 10-08-2011, 11:44 AM
Last Post: smart paper boy
  Program to Encrypt and decrypt a text data using RSA algorithm smart paper boy 0 2,533 10-08-2011, 11:43 AM
Last Post: smart paper boy
  Program to implement the data link layer framing method character stuffing smart paper boy 0 7,956 10-08-2011, 11:41 AM
Last Post: smart paper boy
  Program to implement the data link layer framing method bit stuffing smart paper boy 0 2,896 10-08-2011, 11:41 AM
Last Post: smart paper boy
  To write a program to print “Hello World” in CORBA. smart paper boy 0 1,988 21-07-2011, 09:52 AM
Last Post: smart paper boy
  To write a C# program to perform encryption and decryption of the given data. smart paper boy 0 1,783 21-07-2011, 09:50 AM
Last Post: smart paper boy

Forum Jump: