FLOATING-POINT ARITHMETIC • Floating-point representation and
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent...
-
Upload
bernice-wells -
Category
Documents
-
view
222 -
download
1
Transcript of 1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent...
4
Normalized and Unnormalized■ A floating point number is said to be normalized if the
number after the radix point is a non-zero that is, it is not a ‘0’ value.
■ Unnormalized floating number is when the number after the radix point is ‘0’.
■ Example: normalized
unnormalized
unnormalized
normalized
5
Normalization Process■ Normalization is the process of deleting the zeroes until
a non-zero value is detected.
■ Example :
■ A rule of thumb:– moving the radix point to the right subtract exponent – moving the radix point to the left add exponent
8
Biased Exponent■ To eliminate the sign for the exponent value that is the
exponent will be positive.
sign Biased exponent
9
Conversion to Floating Point Number
■ Normalized the number
■ Change the number to biased exponent
■ Form the word (3 fields)
10
Example 3■ Transform –33.625 to floating point word using the following format (radix
2)
■ The biased constant
15
IEEE 754 Encoding ofFloating-Point Numbers
■ Purpose of NaNs is to allow programmers to postpone some tests and decision a later time in the program when it is convenient.
16
Challenge of Negative Exponents■ Placing the exponent before the significand simplifies sorting of
floating-point numbers using integer comparison instructions.
■ However, using 2’s complement in the exponent field makes a negative exponent look like a big number.
24
Decimal Floating-Point AdditionAssume 4 decimal digit for significand and 2 decimal digits for exponent
27
Decimal Floating-Point MultiplicationAssume 4 decimal digit for significand and 2 decimal digits for exponent
29
Floating-Point ALU
010 1 0 1
Control
Small ALU
Big ALU
Sign Exponent Significand Sign Exponent Significand
Exponentdifference
Shift right
Shift left or right
Rounding hardware
Sign Exponent Significand
Increment ordecrement
0 10 1
Shift smallernumber right
Compareexponents
Add
Normalize
Round