I'm attempting to develop an FPU (Compliant with ieee 754) as a graduation project and I have some troubles with the sum function. The last 2 weeks I was investigating and working some operations (many of them) on paper, the aim is to understand how this standard works. So, this is the question....I'm confused because when I perform an add of numbers with the same sign I've got correct results but I have problems when adding numbers with opposite sign. For example,the add of -1200.23 and 500.125. The ieee 754-2008 single precision representation of the numbers is (sign bit---exponent----significand):
-1200.23 = 1 --- 10001001 --- 1.001 0110 0000 0111 0101 1100
500.125 = 0 --- 10000111 --- 1.111 1010 0001 0000 0000 0000
The exponents are 137 for -1200.23 and 135 for 500.125. The exponents are not equal so we need to normalize the significand of 500.125, to do this I shift right two times the significand (137-135 = 2). The new mantissa of 500.125 is:
0.011 1110 1000 0100 0000 0000
***Before continue I want to say that I've seen a similar question (How to subtract IEEE 754 numbers? it doesn't answer my question*****
So, the next step is to add the significands or subtract the significands? I've trying in both ways but I've still got incorrect results... Thanks.....