Decimal To Floating Point: Property of STI
Decimal To Floating Point: Property of STI
Solution:
1. Observe the Sign: For -12.0 the sign is negative. For 12:
This means that the first bit will be 1, if positive Calculation Quotient Remainder
the first bit will be 0. 12/2 6 0
6/2 3 0
2. From Decimal to Binary: Convert decimal 3/2 1 1
number to binary scientific notation, processing 1/2 Cannot be 1
the integral and fractional part independently.
Converting the fractional part to binary: To
The integral part is the number in front of the convert the fractional part to the binary system,
decimal point (-12), the fractional part is the rest multiply the number repeatedly by 2, keeping
after the decimal point (.0). Hence, track of each integer part of the results, until the
acquired fractional part is equal to zero.
Converting the integral part to binary: To
convert the integral part to the binary system, For 0:
divide the number repeatedly by 2, keeping track Product
of each remainder, until a quotient acquired is Integer Fractional
equal to 0. Part Part
Step 1 0.0 * 2 = 0 . 0
Mantissa = 1000
04 Handout *Property of
STI
IT1903
Step 2 0.75 * 2 = 1 . 5
0.5 * 2 = 1 . 0
04 Handout *Property of
STI
IT1903
6. Place the mantissa into the mantissa field of the number. Omit the leading
7. Combine sign, one, and adjust
exponent, its length to 23 bits, by fillin
and significant.
= 41FB000016
Solution:
1. Convert: 𝑒716 = 111001112. 2. Separate:
1 110 0111
3. Mantissa: 1.0111 4. Exponent: 1102 = 610; 6 − 3 = 3.
5. De-normalize: 1.01112 × 23 = 1011.1 6. Convert:
Exponents 23 22 21 20 2−1
Place
8 4 2 1 0.5
Values
Bits 1 0 1 1. 1
Value 8 +2 +1 +0.5 =11.5
7. Sign: negative. Answer: e7 is -11.5
2. Convert the 32-bit floating point number 44361000 (in hex) to decimal.
Solution:
1. Convert: 2. Separate:
4436100016 = 0 10001000 01101100001000000000000
010001000011011000010000000000002.
3. Exponent:
100010002 = 13610; 136 − 127 = 9.
4. De-normalize:
1.011011000012 × 29 = 1011011000.01
5. Convert:
Exponents 29 28 27 26 25 24 23 22 21 20 2−1 2−2
Place
512 256 128 64 32 16 8 4 2 1 0.5 0.25
Values
Bits 1 0 1 1 0 1 1 0 0 0. 0 1
Value 512 +128 +64 +16 +8 +0.27 =728.25
6. Sign: positive Answer: 44361000 is 728.25
04 Handout *Property of
STI