The IEEE Format for storing float single precision

  • Slides: 14
Download presentation
The IEEE Format for storing float (single precision) data type Use the “enter” key

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

Converting a decimal value with a fractional portion to binary Watch the Video first:

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.

Converting a binary value with a fractional portion to floating point notation (for storing

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

Let’s use as an example: 1011. 00112 Step 1: Move the radix point to

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

Let’s use as an example: 1011. 0011 2 Step 2: Determine the exponent. It

Let’s use as an example: 1011. 0011 2 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 23 BASE 2 VALUE NUMBER OF PLACES RADIX POINT MOVED LEFT FROM INITIAL POSITION

Let’s use as an example: 1011. 00112 The value in floating point notation: 1.

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

SIDE NOTE # 1 The binary value: 0. 0001012 would require the radix point

SIDE NOTE # 1 The binary value: 0. 0001012 would require the radix point to be moved to the RIGHT (4 places) thus creating a NEGATIVE exponent End result: 1. 01 x 4 2

Storing a binary value represented in floating point notation in a 32 bit float

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)

The Float Register: The Example: 1. 0110011 x 23 1 st bit stores the

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

Important! The You Float Register: must use all 8 bits. The Example: 1. 0110011

Important! The You Float Register: must use all 8 bits. The Example: 1. 0110011 x 23 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. 10000010 next 8 bits store the exponent with a “bias” applied. (bits 2 - 9) 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 (28 = 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 = 13010 = 100000102

Important! The Float Register: You must use all 23 bits. Thus, the value may

Important! The Float Register: You must use all 23 bits. Thus, the value may require “padding” of trailing zeros (on the right). 10000010 011000000000 The mantissa of the example is. o 110011. Yikes! Where did the 1 to the LEFT of the radix point go? IMPLIED It is 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. last 23 bits store the mantissa (bits 10 - 32) 0 The Example: 1. 0110011 x 23

Watch these videos to reinforce the concept… IEEE 754 Floating Point Representation Part II

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

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

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

The end. Questions? Please e-mail me. (f-porps@neiu. edu) Works Cited: "Base-10 to Base-2 Conversion:

The end. Questions? Please e-mail me. (f-porps@neiu. edu) Works Cited: "Base-10 to Base-2 Conversion: Method. " You. Tube. 13 Feb. 2013. <http: //www. youtube. com/watch? v=96 MJVz. VKo. IE>. "IEEE-754 Single Precision Representation: Part 1 of 2. " You. Tube. 13 Feb. 2013. <http: //www. youtube. com/watch? v=atla. D 7 M 30 s. Y>. "IEEE-754 Single Precision Representation: Part 2 of 2. " You. Tube. 13 Feb. 2013. <http: //www. youtube. com/watch? feature=endscreen&NR=1&v=b 7 u_o. Fl. G 4_M>. "Base-10 to Base-2 Conversion: Another Method. " You. Tube. 13 Feb. 2013. <http: //www. youtube. com/watch? annotation_id=annotation_804930&feature=iv&src_vid=96 MJVz. VKo. IE&v=h. Xhz 80 U 8 Fjo>.