Homework 2

Please do the following exercises starting on page 87 in the book. In addition, please write a program (in the programming language of your choice, but it must run on cslab103), which demonstrates the fundamentals of floating point arithmetic. We will use the book's floating point representation (1 sign bit, 5 bit excess 16 exponent, 8 bit normalized mantissa, but the most significant 1 is not encoded)
   seeeeemmmmmmmm = (-1)s1.mmmmmmmm x 2e-16
Your program should prompt the user for two floating point numbers, print out the representation for each, add the two numbers, and print out the final representation and decimal equivalent. You must add within the representation system,but you may assume you have a 28 bit register in which to perform the addition.

You should represent your registers (where you store your numbers in the book's representation) as arrays of characters or integers, each can only hold a 1 or 0.

This is worth 30% of this homework score and should be submitted as documented source code, along with instructions for compiling an executing, by email.

You may assume all input is given in the form:

 [+/-]d+.d+
+3.0 is permitted but 3 is not (this is to simplify input, read a char, int, char, int)