This project is to practice what we studied in Error Control.


Project 1

1. Hamming Method for Error Correction

1.1 Write a program in C (or C++) that can convert a bit stream of a message into a frame by using Hamming coding. The bit stream is the input parameter of the program. For example, given an input parameter as 1001000, the correct output of the frame is 00110010000. Input bit stream will have 1 to 64 bits.

Some self-testing examples are:
Input 1001000; output 00110010000
Input 1101001100110101; output 011110110011001110101
Input 1010101; output 11110100101
Input 11111111; output 111011101111

1.2 Write a program in C (or C++) that can correct a single-bit error of a frame by using Hamming coding and output the packet (raw data). The incoming frame is the input parameter of the program. The output is the bit stream of a packet. For example, given an input parameter as 00110010001 (the correct frame should actually be 00110010000), the output bit stream is 1001000. Input frame will have 3 to 71 bits.

Some self-testing examples are:
Input 00110010000; output 1001000
Input 00110010001; output 1001000
Input 011110110011001110101; output 1101001100110101
Input 11110100101; output 1010101
Input 111011101111; output 11111111
Input 11110000101; output 1010101

2. CRC for Error Detection

Write a program in C (or C++) that can convert a bit stream of a message into a frame by using CRC. The bit stream is the first input parameter of the program, which will have 8 to 128 bits. The generator function is the second input parameter of the program, which will have 4 to 16 bits. For example, if the generator function is x^4 + x + 1, the second input will be 10011. The output should be the transmitted bit stream with its CRC checksum bits; see example in Figure 3-9 in the textbook.

Some self-testing examples are:
Input = 10011101, generator 1001, output 10011101100.
Input = 1101011011, generator 10011, output 11010110111110.
Input = 10011101, generator 1001, output 10011101100.
Input = 1101011011011100, generator 1101110111011101, output 1101011011011100110101101101110

What to turn in:

For this project you will email GTA Sean Higgins (email: shiggins@uccs.edu) one ZIP file (in the name of P1_Yourname.zip) of all source code, together with a Readme in DOC or PDF specifying 1) how to compile and execute your code, and 2) the self-testing results of your program (say with some screenshot) and any important feature you want to specify (if your program does not work, please notify it clearly).

Note that your source code will be evaluated. The program will perform appropriate error handling. It will display some appropriate message if the user’s command fails in any way. Towards this end, document your code carefully. For example, use comments to indicate what the corresponding portions of the code do. You might be asked to give a quick demo on your laptop or ENG 138.

If any question, please ask by sending email to Prof. Zhou at xzhou@uccs.edu.