CS302 Assignment 1
CS302 Assignment 1
Assignment: 01
Question No 01:
Convert the following 32-Bit Binary Floating-Point Number into a Decimal Number.
11000100110110101011010111000111
100010012
128+8+1 =137
100010012 =13710
Calculate the unbiased exponent: IEEE 754 format uses a bias of 127 for 32-bit floating-point numbers. So,
subtract 127 from the exponent we just calculated:
137-127=10
11000100110110101011010111000111
In IEEE 754 format, the mantissa (or fraction) is assumed to have an implicit leading 1 in normalize form. So, we
can write the mantissa as:
11000100110110101011010111000111
For the fractional part 10110101011010111000111, we interpret each binary digit after the decimal point as a
negative power of 2:
−1 −2 −3 −4 −5 −6 −7 −8 −9 −1 0
1∗2 + 0∗2 + 1∗2 +1∗2 + ¿ 0∗2 +1∗2 +0∗2 +1∗2 +0∗2 +1∗2 +¿
−1 1 −12 −1 3 −1 4 −15 −1 6
1∗2 + 0∗2 +1∗2 + 0∗2 +1∗2 +1∗2 +¿
−1 7 −1 8 −1 9 −20 −2 1 −22 −23
1∗2 + 0∗2 + 0∗2 + 0∗2 +1∗2 +1∗2 +¿ 1∗2
0.5+0+0.125+0.0625+0+0.0156+0+0.0039+0+0.0009+0.0004+0+0.0001+0+0.00003+0.00001+0.000007+0+0+0+0
+0+0
0.7109375
1+0.7109375 = 1.7109375
-1751.5
11000100110110101011010111000111
-1751.5