Presentation is loading. Please wait.

Presentation is loading. Please wait.

Handling Denormalized Numbers

Similar presentations


Presentation on theme: "Handling Denormalized Numbers"— Presentation transcript:

1 Handling Denormalized Numbers
IEEE Floating Point Handling Denormalized Numbers 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

2 Copyright 2006 - Joanne DeGroat, ECE, OSU
Lecture overview Denormalized setup for operation with normalized 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

3 The floating point standard
Single Precision Value of bits stored in representation is: If e=255 and f /= 0, then v is NaN regardless of s If e=255 and f = 0, then v = (-1)s ¥ If 0 < e < 255, then v = (-1)s 2e-127 (1.f) – normalized number If e = 0 and f /= 0, the v = (-1)s (0.f) Denormalized numbers – allow for graceful underflow If e = 0 and f = 0 the v = (-1)s 0 (zero) 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

4 Copyright 2006 - Joanne DeGroat, ECE, OSU
Consider the example A = 100 $42C8 0000   S = 0 E = = 133 – 127 = 6 F = ManA =  B = 25 $41C8 0000   E = = 131 – 127 = 4 ManB = 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

5 Copyright 2006 - Joanne DeGroat, ECE, OSU
Example Continued For A + B need to align binary pt by 2 places ManA = ShfManB = aligned to exp of 6 Sum is with a bin exp of 6 $ F A 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

6 Copyright 2006 - Joanne DeGroat, ECE, OSU
Some basics Consider or 25 This could be represented as x 24 OR x 26 to have the same value Consider as the fractional part of a denormalized number This has value x 2-126 Or with a shift by 1 position x 2-127 (Note this is a shift left on a fixed binary pt) 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

7 Copyright 2006 - Joanne DeGroat, ECE, OSU
Why do this With the shift it has the same value but the format becomes: v = (-1)s (x.xxxx) = (-1)s 2e-127 (x.xxxx) where x.xxxx is the shifted fractional part and the e here is 0 This is the same format as normalized number when e=0 and the operation now does not care that one of the inputs was denormalized. 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU

8 Copyright 2006 - Joanne DeGroat, ECE, OSU
General Rule Fixed binary point and shift digits to Shift left – subtract 1 from exponent to Shift right – add 1 to exponent Fixed binary digits and move binary point to Move right – subtract 1 from exponent to Move left – add 1 to exponent 1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU


Download ppt "Handling Denormalized Numbers"

Similar presentations


Ads by Google