CS 636: Spring 2008
Programming Assignment 1
Deadline : Feb 21st -- 9am
Write a program (in C, Java, or C++) for a sender that takes
a bit stream and computes its CRC, as well as a second program for a
receiver that is very
similar to the first except that it checks to see whether a received
packet has the right CRC.
The input to the sender program should be a string in C (which you read
from a file) containing
ASCII 0's and 1's that represents the message to be checksummed. Your
output should be an
8-bit CRC for the degree 8 polynomial x^8+x^6+x^2+x+1. (i.e., the
binary string 101000111).
Describe the logic for your 2 programs using good comments. Run your
program on the
sequence of characters in a file CRC input I will put up on the
webpage. Please email me the CRC code on or before Feb 21st 9am.
Your code should take a file as a command line argument and output the
crc value in ascii 0's and 1's. Your verification part should be able
to take a message where the last 8 bits are basically the CRC and
should output a true or a false. Note, the idea for verification is not
to actually split the message and the crc, but instead to take the
entire message and see whether the resulting CRC (for the message + CRC
appended) is a 0. This is the way verification is done in reality.
Run : crc_compute -f <message input file>
Output : 00100110
Run : crc_verify -f <message input file with CRC 00100110
appended>
Output : True
Run: crc_verify -f <message input file with CRC 01000101
appended>
Output : False
Here is the input for which I need the answer.
00100101110111111111110101011100111001111010100001111111001011100