ASSIGNMENT NO.
01
NAME:Daniyal Saif
STUDENT ID: BC200406259
SUBJECT: DIGITAL LOGIC DESIGN (CS302)
QUESTION NO. 01
Convert the following 32-Bit Binary Floating-point number into a decimal number.
11000100110110101011010111000111
SOLUTION
1. Representation of 32-bit floating-point number
Sign bit (S): 1 Exponent (E): 8 bits Mantissa (M): 23 bits
1 Sign bit: 0(+ve) , 1(-ve)
E = 10001001 M = 10110101011010111000111
S = 1(-ve)
2. Conversion of Exponent into Decimal
E = 10001001
= (1 × 27) + (0 × 26) + (0 × 25) + (0 × 24) + (1 × 23) + (0 × 22) + (0 × 21) + (1 × 20)
= (1 × 128) + (0 × 64) + (0 × 32) + (0 × 16) + (1 × 8) + (0 × 4) + (0 × 2) + (1 × 1)
= 128 + 0 + 0 + 0 + 8 + 0 + 0 + 1
= 137
3. Find: Actual Exponent
e = E - 127
= 137 - 127
= 10
4. Mantissa Normalization
M = 10110101011010111000111
= 1.0110101011010111000111 (normalized)
5. Conversion of Mantissa Fraction Part into decimal
(0 × 2-1 ) + (1 × 2-2) + (1 × 2-3) + (0 × 2-4 ) + (1 × 2-5 ) + (0 × 2-6 ) + (1 × 2-7) + (1 × 2-8)
+ (0 × 2-9 ) + (1 × 2-10) + (1 × 2-11) + (1 × 2-12) + (1 × 2-13) + (1 × 2-14) + (0 × 2-15) + (0 ×
2-16) + (0 × 2-17) + (1 × 2-18) + (1 × 2-19) + (1 × 2-20) + (0 × 2-21) + (0 × 2-22) + (0 × 2-23)
= 0 + 0.25 + 0.125 + 0 + 0.03125 + 0 + 0.0078125 + 0.00390625 + 0 + 0.0009765625
+ 0.00048828125 + 0.000244140625 + 0.0001220703125 + 0.00006103515625 + 0 +
0 + 0 + 0.000003814697265625 + 0.0000019073486328125 +
0.00000095367431640625
≈ 0.7109375
6. Add Integer part in the fraction part of Mantissa
= 1 + 0.7109375
≈ 1.7109375
7. For Finding Actual value Applying Exponent & Sign bit
x = (-1)S × M × 2e
= (-1)1 × 1.7109375 × 210
= -1 × 1.7109375 × 1024
= -1751.5 Approx
Final Answer: ≈ -1751.5