GATE | Gate IT 2008 | Question 7
The following bit pattern represents a floating point number in IEEE 754 single precision format
1 10000011 101000000000000000000000
The value of the number in decimal form is
(D) None of these
To convert the floating point into decimal, we have 3 elements in a 32-bit floating point representation:
Sign bit is the first bit of the binary representation. ‘1’ implies negative number and ‘0’ implies positive number Exponent is decided by the next 8 bits of binary representation. 131-127=4
Hence the exponent of 2 will be 4. i.e 24=16.
127 is the unique number for 32 bit floating point representation. It is known as bias. It is determined by 2k-1-1 where ‘k’ is the number of bits in exponent field.
Thus bias = 3 for 8 bit conversion and 127 for 32 bit. (28-1-1 = 128-1=127)
Mantissa is calculated from the remaining 24 bits of the binary representation. It consists of ‘1’ and a fractional part which is determined by:
The fractional part of mantissa is given by:
1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) +………=0.625
Thus the mantissa will be 1+0.625=1.625
The decimal number hence given as
Sign*Exponent*Mantissa = (-1)*(16)*(1.625) = -26.
This solution is contributed by Kriti Kushwaha.,
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.