Presentation is loading. Please wait.

Presentation is loading. Please wait.

The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.

Similar presentations


Presentation on theme: "The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show."— Presentation transcript:

1 The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.

2 Converting a decimal value with a fractional portion to binary Watch the Video first: Click on this link: Base-10 to Base-2 Conversion: Method Then, continue to view this show.

3 Converting a binary value with a fractional portion to floating point notation (for storing in IEEE standard for single precision float data type)

4 Let’s use as an example: 1011.0011 2 Step 1: Move the radix point to the right of the of the leftmost significant digit, and count the number of places the radix point moved. 1011.0011 2 IT MOVED 3 PLACES TO THE LEFT IN THIS CASE.

5 Step 2: Determine the exponent. It is the number of positions the radix point moved (in this case to the left - creating a positive exponent) Now the value looks like this: 1.0110011 x 2 3 BASE 2 VALUE NUMBER OF PLACES RADIX POINT MOVED LEFT FROM INITIAL POSITION

6 Let’s use as an example: 1011.0011 2 The value in floating point notation: 1.0110011 x 2 3 can now be manipulated for storage in the 32 bit (single precision) register.

7 SIDE NOTE # 1 The binary value: 0.000101 2 would require the radix point to be moved to the RIGHT (4 places) thus creating a NEGATIVE exponent End result: 1.01 x 2 -4

8 Storing a binary value represented in floating point notation in a 32 bit float register (for storing in IEEE standard for single precision float data type)

9 The Float Register: 1st bit stores the sign of the value 0 for positive, 1 for negative 1st bit stores the sign of the value 0 for positive, 1 for negative The Example: 1.0110011 x 2 3 The Example: 1.0110011 x 2 3 0 The example is a positive value, so zero (0) is placed in the sign bit.

10 The Float Register: next 8 bits store the exponent with a “bias” applied. (bits 2 - 9) next 8 bits store the exponent with a “bias” applied. (bits 2 - 9) The Example: 1.0110011 x 2 3 The Example: 1.0110011 x 2 3 0 The exponent of the example is 3. Since exponents can be positive or negative, a bias is used. In other words the 256 possible exponent values that can be stored in 8 bits (2 8 = 256) in simplified terms must be split in half, half for positive exponents and half for negative exponents. So, add 127 to the exponent and store its binary value 3+ 127 = 130 10 130 10 = 10000010 2 10000010 Important! You must use all 8 bits. Thus, the value may require “padding” of leading zeros (on the left). Important! You must use all 8 bits. Thus, the value may require “padding” of leading zeros (on the left). More information on the bias and special cases to follow in a video near the end of this show.

11 The Float Register: last 23 bits store the mantissa (bits 10 - 32) last 23 bits store the mantissa (bits 10 - 32) The Example: 1.0110011 x 2 3 The Example: 1.0110011 x 2 3 0 The mantissa of the example is.o110011. Yikes! Where did the 1 to the LEFT of the radix point go? It is IMPLIED but not stored (saving space). Thus the precision of the value is 24 bits even though only 23 bits are stored. So, only the portion of the value to the right of the radix point is stored. 10000010 Important! You must use all 23 bits. Thus, the value may require “padding” of trailing zeros (on the right). Important! You must use all 23 bits. Thus, the value may require “padding” of trailing zeros (on the right). 01100110000000000000000

12 Watch these videos to reinforce the concept… IEEE 754 Floating Point Representation Part I IEEE 754 Floating Point Representation Part II (This video contains more on the bias.) Then, continue the show…

13 Watch this Video to see an alternate method for converting decimal values to binary… alternate method

14 The end. Questions? Please e-mail me. (f-porps@neiu.edu) Works Cited: "Base-10 to Base-2 Conversion: Method." YouTube. 13 Feb. 2013.. "IEEE-754 Single Precision Representation: Part 1 of 2." YouTube. 13 Feb. 2013.. "IEEE-754 Single Precision Representation: Part 2 of 2." YouTube. 13 Feb. 2013.. "Base-10 to Base-2 Conversion: Another Method." YouTube. 13 Feb. 2013..


Download ppt "The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show."

Similar presentations


Ads by Google