Question

In: Computer Science

We want to compute Cyclic Redundancy Check (CRC) for the given the data bits D=110001, generator...

We want to compute Cyclic Redundancy Check (CRC) for the given the data bits D=110001, generator G=1001, and 3 CRC bits (i.e., r=3),.

Explain the algorithm and implement the CRC computation in a programming language (e.g., C, C++, and Python) with the above setting.

Solutions

Expert Solution

Here I implemented CRC algorithm in C language.

#include <stdio.h>
#include <string.h>
int main()
{
   int i,j,keylen,msglen;
   char input[100],key[30],temp[30],quot[100],rem[30],key1[30];
   printf("Enter Data D: ");
   gets(input);
   printf("Enter Generator G: ");
   gets(key);
   keylen=strlen(key);
   msglen=strlen(input);
   strcpy(key1,key);
   for (i=0;i<keylen-1;i++)
{
       input[msglen+i]='0';
   }
   for (i=0;i<keylen;i++)
   temp[i]=input[i];
   for (i=0;i<msglen;i++)
   {
       quot[i]=temp[0];
       if(quot[i]=='0')
for (j=0;j<keylen;j++)
key[j]='0';
else
for (j=0;j<keylen;j++)
key[j]=key1[j];
       for(j=keylen-1;j>0;j--)
       {
           if(temp[j]==key[j])
           rem[j-1]='0';
else
           rem[j-1]='1';
       }
       rem[keylen-1]=input[i+keylen];
       strcpy(temp,rem);
   }
   strcpy(rem,temp);

   printf("\nRemainder is ");
   for (i=0;i<keylen-1;i++)
   printf("%c",rem[i]);

   printf("\nFinal data is: ");
   for (i=0;i<msglen;i++)
   printf("%c",input[i]);

   for (i=0;i<keylen-1;i++)
   printf("%c",rem[i]);

   return 0;
}

Output :


Related Solutions

Cyclic Redundancy Check Given the data bits D = 110100101011, the generator G = 110011, r...
Cyclic Redundancy Check Given the data bits D = 110100101011, the generator G = 110011, r = 5. 1) Find the CRC. Give the detailed steps of your computation. 2) What does the sender send? 3) Show how the receiver verifies the received data. Assume there is no error. (mostly need help with this step!)
analyze cyclic redundancy check CRC using the following subheading i. concept explanation ii. method used for...
analyze cyclic redundancy check CRC using the following subheading i. concept explanation ii. method used for implementing CRC iii. Illustration of each method iv. merits and demerits in relation to performance
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D...
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D + 1. a) (10 points) Determine the code word for the message, 1010. b) (10 points) Determine the code word for the message, 1100. c) (9+1= 10 points) Determine the error polynomial for the received word, 1110101. Is the received word correct?
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D...
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D + 1. a) (10 points) Determine the code word for the message, 1010. b) (10 points) Determine the code word for the message, 1100. c) (9+1= 10 points) Determine the error polynomial for the received word, 1110101. Is the received word correct?
Design a parity bit generator and checker. A system transmits 4 bits of data. Design generator...
Design a parity bit generator and checker. A system transmits 4 bits of data. Design generator and checker in same schematic use XOR gate. DO NOT USE KMAPS. Include truth tables. I am trying to understand the problem. Include boolean expression and explain you work please. Please explain I need to Learn
Consider a (15,5) linear block code (cyclic) in systematic form. The generator polynomial is given as...
Consider a (15,5) linear block code (cyclic) in systematic form. The generator polynomial is given as gx=1+X+X2+X5+X8+X10 . Design and draw the circuit of the feedback shift register encoder and decoder. Use the encoder obtained in part a to find the code word for the message [01011 ] . (Assume the right most bit is the earliest bit)                                                                 Repeat the steps of part b for decoding.                                                                                         Verify the codeword obtained in part b...
A. Provides data independence B. Encourages data sharing C. Minimizes data redundancy D. Increases data inconsistency...
A. Provides data independence B. Encourages data sharing C. Minimizes data redundancy D. Increases data inconsistency Which of the following statements about database systems is (are) true? (Check all that apply.)
Design a 1-bt eror correction code for m=8 data bits and r=4 check bits. The 8...
Design a 1-bt eror correction code for m=8 data bits and r=4 check bits. The 8 data bits are 10101011. For odd parity,assign the 4 check bits ,and give the 22 bits CODE WORD.
Given the sample of observation {3, 6, 8, 7, 10} we want to check the null...
Given the sample of observation {3, 6, 8, 7, 10} we want to check the null hypothesis that the median is 6. Describe the steps of a bootstrap-based procedure to perform this test.
Given the sample of observation {3, 6, 8, 7, 10} we want to check the null...
Given the sample of observation {3, 6, 8, 7, 10} we want to check the null hypothesis that the median is 6. Describe the steps of a bootstrap-based procedure to perform this test.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT