bc240219177 CS302 Assignment
bc240219177 CS302 Assignment
Assignment # 01
BC240219177
Question#1 Solution:
11000100110110101011010111000111.
Convert the following 32-Bit Binary Floating-Point Number into a Decimal Number.
Step-by-Step Conversion:
1. Sign (S):
The sign bit S = 1, so the number is negative.
2. Exponent (E):
The exponent is given by the 8 bits 10001001. First, convert it to decimal:
100010012
= 1 * 2 7+ 0 * 2 6 + 0 * 2 5 + 0 * 2 4 + 1 * 2 3 + 0 * 2 2 + 0 * 2 1 + 1 * 2 0
= 128 + 0 + 0 + 0 + 8 + 0 + 0 + 1
= 137
100010012=13710
The exponent in IEEE 754 is stored with a bias of 127. So, we subtract 127 from
the exponent value to get the actual exponent:
137−127=10
Therefore, the exponent E = 10.
3. Mantissa (M):
10110101011010111000111
In IEEE 754 format, the mantissa (or fraction) is assumed to have an implicit
leading 1 in normalized form. So, we can write the mantissa as:
1.10110101011010111000111