05.03.2015 Views

Representation of Floating Point Numbers in Single Precision ...

Representation of Floating Point Numbers in Single Precision ...

Representation of Floating Point Numbers in Single Precision ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IEEE 754 S<strong>in</strong>gle precision Addition Notes<br />

• If the exponents differ by more than 24, the smaller number will be shifted<br />

right entirely out <strong>of</strong> the mantissa field, produc<strong>in</strong>g a zero mantissa.<br />

– The sum will then equal the larger number.<br />

– Such truncation errors occur when the numbers differ by a factor <strong>of</strong> more than<br />

2 24 , which is approximately 1.6 x 10 7 .<br />

– Thus, the precision <strong>of</strong> IEEE s<strong>in</strong>gle precision float<strong>in</strong>g po<strong>in</strong>t arithmetic is<br />

approximately 7 decimal digits.<br />

• Negative mantissas are handled by first convert<strong>in</strong>g to 2's complement and<br />

then perform<strong>in</strong>g the addition.<br />

– After the addition is performed, the result is converted back to sign-magnitude<br />

form.<br />

• When add<strong>in</strong>g numbers <strong>of</strong> opposite sign, cancellation may occur, result<strong>in</strong>g <strong>in</strong><br />

a sum which is arbitrarily small, or even zero if the numbers are equal <strong>in</strong><br />

magnitude.<br />

– Normalization <strong>in</strong> this case may require shift<strong>in</strong>g by the total number <strong>of</strong> bits <strong>in</strong> the<br />

mantissa, result<strong>in</strong>g <strong>in</strong> a large loss <strong>of</strong> accuracy.<br />

• <strong>Float<strong>in</strong>g</strong> po<strong>in</strong>t subtraction is achieved simply by <strong>in</strong>vert<strong>in</strong>g the sign bit and<br />

perform<strong>in</strong>g addition <strong>of</strong> signed mantissas as outl<strong>in</strong>ed above.<br />

EECC250 - Shaaban<br />

#10 lec #17 W<strong>in</strong>ter99 1-27-2000

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!