CS611
Programming Assignment 4
Fall 2003
Due Sunday October 26


Write a C function, FloatAdd, to emulate IEEE 32-bit floating point addition. The routine should take two 32-bit integers as arguments and should return a 32-bit integer. However, the 32-bit integers should be interpreted to be actually floating point values. The floating point addition should be implemented using only integer operations. The return value should be the same as what is produced by the IEEE floating point hardware when given the same inputs. Be sure to handle NaN and Infinity inputs and results. However, you do not need to handle "denormalized" inputs or results (consider them to be zero).

The directory ~cs611/public/prog4 contains a stub for FloatAdd (in the file "fp.c"), as well as a Makefile and a main routine. This main routine performs a fairly exhaustive test of FloadAdd. Put all your code in the file "fp.c".

Your program will be graded primarily by testing it for correct functionality:

However, remember, you may lose points if your program is not properly structured or adequately documented. See the mandatory guidelines given in the course overview webpage.

Only the distributed test cases will be used for grading this assignment.

Your programs will be graded using an Linux/Intel machine so be sure to test in that environment.

Your program should be submitted for grading from a UNH CIS Linux/Intel machine (e.g. turing.unh.edu). Submit only the file "fp.c". To turn in this assignment, type:
~cs611/bin/submit prog4 fp.c

Do not turn in any other files!

Notes: Submissions can be checked by typing:
~cs611/bin/scheck prog4

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday October 27. Late submissions will be accepted at the penalty of 5% per day up to one week late.

Remember: as always you are expected to do your own work on this assignment.


Last modified on October 3, 2003.

Comments and questions should be directed to hatcher@unh.edu