This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ion: how is correctly rounded arithmetic implemented? Let us consider the addition of two oating point numbers x =
m 2E and y = p 2F , using IEEE single precision. If the two exponents E
and F are the same, it is necessary only to add the signi cands m and p. The
nal result is (m + p) 2E, which then needs further normalization if m + p is
2 or larger, or less than 1. For example, the result of adding 3 = (1:100)2 21
to 2 = (1:000)2 21 is:
( 1:10000000000000000000000
+ ( 1:00000000000000000000000
= ( 10:10000000000000000000000 )2 21
) 2 21
)2 21 and the signi cand of the sum is shifted right 1 bit to obtain the normalized
format (1:0100 : : : 0)2 22 . However, if the two exponents E and F are
17 di erent, say with E > F , the rst step in adding the two numbers is to align
the signi cands, shifting p right E ; F positions so that the second number
is no longer normalized and both numbers have the same exponent E . The
signi cands are then added as before. For example, adding 3 = (1:100)2 21
to 3=4 = (1:100)2 2;1 gives:
( 1:1000000000000000000000 )2 21
+ ( 0:0110000000000000000000 )2 21
= ( 1:1110000000000000000000 )2 21:
In this case, the result does not need further normalization.
Now consider adding 3...
View
Full
Document
This note was uploaded on 02/12/2014 for the course MATH 4800 taught by Professor Lie during the Spring '09 term at Rensselaer Polytechnic Institute.
 Spring '09
 LIE

Click to edit the document details