Upload
meagan-hood
View
213
Download
0
Embed Size (px)
Citation preview
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:
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 in IEEE standard for single precision float data type)
Let’s use as an example: 1011.00112
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.00112
IT MOVED 3 PLACES TO THE LEFT IN THIS CASE.
Let’s use as an example: 1011.00112
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 23B
AS
E
2 V
ALU
E
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.0110011 x 23
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 to be moved to the RIGHT (4 places)
thus creating a NEGATIVE exponent
End result: 1.01 x 2-4
Storing a binary value represented in
floating point notationin a 32 bit
float register
(for storing in IEEE standard for single precision float data type)
The Float Register:1s
t bi
t st
ores
the
sig
n of
the
val
ue0
for
posi
tive,
1 f
or n
egat
ive
The Example:
1.0110011 x 23
0
The example is a positive value, so zero (0) is placed in the sign bit.
The Float Register:
next
8 b
its s
tore
the
exp
onen
t w
ith
a “b
ias”
app
lied.
(bits
2 -
9)
The Example:
1.0110011 x 23
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 value3+ 127 = 13010
13010 = 100000102
10000010
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.
The Float Register:
last
23
bits
sto
re t
he m
antis
sa(b
its 1
0 -
32)
The Example:
1.0110011 x 23
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).
01100110000000000000000
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…
Watch this Video to see an alternate method
for converting decimal values to
binary…
alternate method
The end.Questions?
Please e-mail me.([email protected])
Works Cited:
"Base-10 to Base-2 Conversion: Method." YouTube. 13 Feb. 2013. <http://www.youtube.com/watch?v=96MJVzVKoIE>.
"IEEE-754 Single Precision Representation: Part 1 of 2 ." YouTube. 13 Feb. 2013. <http://www.youtube.com/watch?v=atlaD7M30sY>.
"IEEE-754 Single Precision Representation: Part 2 of 2 ." YouTube. 13 Feb. 2013. <http://www.youtube.com/watch?feature=endscreen&NR=1&v=b7u_oFlG4_M>.
"Base-10 to Base-2 Conversion: Another Method ." YouTube. 13 Feb. 2013. <http://www.youtube.com/watch?annotation_id=annotation_804930&feature=iv&src_vid=96MJVzVKoIE&v=hXhz80U8Fjo>.