|
CS-182 -- Lab 5: Hamming Coder Winter Quarter 1999-2000 Electrical Engineering and Computer Science Department CC-27C, 277-7339 PurposeThe purpose of this lab is to provide the student with an opportunity to implement the solution to a "real-world" problem. This lab features the use of conditional statements, file stream operations, the boolean class, and introduces (at long last) functions. AssignmentElectronic communications is often hampered by external interference which may distort the data while in transit between the sender and receiver. For example, a noisy phone line may garble a message being sent between two modems. In this lab we will take a look at a technique that can identify and correct transmission errors. The Hamming code is a technique which requires extra data to be sent in order to identify and correct errors. The method requires a packet size of seven bits, and we assume that there is as most one error in each packet. Three of these bits are data bits and the other four bits are "checker" bits. We label the data bits as p1, p2, and p3 and the "checker" bits as i1, i2, i3, and i4. The scheme is most easily described graphically. Consider the following figure: ![]() For a correctly transmitted signal, each of the circles should contain an even number of ones (and an even number of zeroes). Write a function called HammingCheck() that will:
Write a program that will:
Hopefully this is obvious, but your program should call HammingCheck() in order to determine if an error exists in each data packet. Programming consideration: It is always good in program design to consider potential modifications that may be required a some later date. Be sure to keep this in mind when designing your program. Lab report (due 11:00pm, the day prior to week 7 lab)The lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. If you have any questions, consult the instructor. Electronic Submission Formatting NoteTo include the circles figure (shown above) in your report, just include the following in text where you would like the figure to appear:
\begin{center}
\includegraphics[width=.5\textwidth]{hamming}
\end{center}
This page was created by Dr. Christopher C. Taylor, copyright 1999. |