CO04
CO04
and
Floating Point Arithmetic Unit
• 0 for positive,
• 1 for negative;
10000110
10100100
-2 1010 0101 +5
Seven Negative 1001 0110
Numbers and -1 1000 0111 +6
“Negative” Zero -0 +7
Positive Value:00000110
Complemented: 11111001
Ex 3
Step 2: Complement the entire positive
value
Complemented: 10101111
00000110
(left complemented) --> 11111010
7610 = 010011002
2610 = 000110102
32-bit example:
+9
0 000 0000 0000 0000 0000 0000 0000 1001
1 111 1111 1111 1111 1111 1111 1111 0111 -9
0100 (+4)
+1101 (-3)
0001 (+1)
NOTE: A carry to the leftmost column has
been ignored.
The result, 0001, is the code for +1, which IS
the sum of +4 and -3.
Range = 0 to (2n – 1)
where n is the number of bits used to store
the unsigned integer.
Step 2: Collect the whole parts in forward order. Put them after the
radix point
. .5 .25 .125 .0625
. 0 1
1 2 9 10 32
Step 1.
Compute the binary equivalent of the
whole part and the fractional part. (i.e.
convert 40 and .15625 to their binary
equivalents)
Dr. Shubhajit Roy Chowdhury SCEE, IIT MANDI
Decimal Floating Point to
IEEE standard Conversion
40 .15625
- 32 Result: -.12500 Result:
8 101000 .03125 .00101
- 8 -.03125
0 .0
101000.00101 = 1.0100000101 x 25
127 + 5 = 132
13210 = 100001002
0 10000100 01000001010000000000000
24 .75
- 16 Result: - .50 Result:
8 11000 .25 .11
- 8 - .25
0 .0
So: -24.7510 = -11000.112
Step 2.
Normalize the number by moving the decimal
point to the right of the leftmost one.
-11000.11 = -1.100011 x 24
1 01111101 010..0
Mantissa Exponent
1 . ____________ x 2 ----
Add/
Sub
Selective complement
Mu x Sub and possible swap
Align significands
cout cin
Control Add
& sign
logic
Normalize
Round and
selective complement
Add Normalize
Division
Unpack
XOR Add
Exponents
Multiply
Significands
Adjus t
Exponent Normalize
Round
Adjus t
Normalize
Exponent
Pack
Product