Homework 5

Remember, homeworks are graded, so you must do your own work. If you do not follow this policy, you will be given a failing grade in the course, and risk college disciplinary action.

Assignment:

First, check out Quanfei Wen's IEEE-754 Web Page and be sure you know how to convert decimal numbers to single and double precision floating point numbers. Try doing +123.375 and -0.1 yourself manually, then check your work using the web page.

Now, show the steps to add these two numbers together in binary, showing all work on a piece of paper, for both single and double precision representations. Write the result in hexadecimal. Check your result (which better be something like 123.275!) against the web page to be sure you did it right.

Bonus: (counts as an extra homework grade) Write a C, C++, or Java program that works the opposite of the web page: the user enters the values of the fields of a floating point number in decimal or binary, and your program displays the decimal equivalent. Your program does not have to have a graphical user interface. You can get credit for this if you submit it by April 21 (the first class after Spring Break).