• edited by
17,620 views
50 50 votes

The value of a $\text{float}$ type variable is represented using the single-precision $\text{32-bit}$ floating point format of $\text{IEEE-754}$ standard that uses $1$ $\text{bit}$ for sign, $\text{8 bits}$ for biased exponent and $\text{23 bits}$ for the mantissa. A $\text{float}$ type variable $X$ is assigned the decimal value of $−14.25$. The representation of $X$ in hexadecimal notation is

  1. $\text{C1640000H}$
  2. $\text{416C0000H}$
  3. $\text{41640000H}$
  4. $\text{C16C0000H}$

6 Answers

Best answer
32 32 votes

IEEE-754 representation for float (single-precision) type is as follows$$\begin{array}{|c|c|c|}\hline\overset{0}{\text{Sign}}&\overset{1-8}{\text{Exponent}}&\overset{9-31}{\text{Mantissa}}\\\hline\end{array}$$ Thus, the exponent field is of $8$ bits and mantissa is of $23$ bits (precision is actually of $24$ bits due to an implied $1$ mandated in normalized representation; IEEE 754 also allows denormalized numbers which are close to $0$ but this is not applicable to the given question).

The exponent field also requires sign to represent fractions. IEEE 754 does this by giving a bias -- $127$ for single-precision which means we simply subtract $127$ from the represented value to get the actual value. Thus, $0$ becomes $-127$ and $255$ (maximum value representable using $8$ bits becomes $128.$

Now, coming to the given question we need to represent $-14.25$ which equals $-1110.01$ in binary. 

Converting to normalized form (only one $1$ to the left of $.)$ we get 

$-1110.01 = -1.11001 \times 2^{3}$

Since we omit the implied $1$ in IEEE-754 representation we get

  • Mantissa bits $= 11001$
  • Exponent bits $ = 11 + 0111111 = 10000010$ (Adding bias $127)$
  • Sign bit $ = 1$ (since number is negative)

This will be $1\quad 10000010\quad 11001000000000000000000$

Grouping in $4$ bits to convert ot Hexadecimal we get

$1100\quad 0001\quad 0110 \quad 0100 \quad 0000 \quad 0000\quad 0000\quad 0000$

$= C1640000H$

Option A.

More Reference: http://steve.hollasch.net/cgindex/coding/ieeefloat.html

39 39 votes

$\begin{array}{|c|c|c|c|}\hline \textbf{S}&\textbf{BE}&\textbf{M}&\textbf{Value}\\\hline 0/1&\text{All 0's}&\text{All 0's}&0\\0&\text{All 1's}&\text{All 0's}&+\infty\\1&\text{All 1's}&\text{All 0's}&-\infty\\0/1&\text{All 1's}&\text{Non zero}&\text{NaN}\\\hline\end{array}$

$\textbf{Bias} = 2^{N-1}-1$
$N-\text{Number of bits to represent exponent in binary}$

$14.25 = 1110.01000 = 1.11001000\times  2^3$

Biased exponent $= \text{actual} + \text{bias} = 3 + \text{bias}$
where; $\text{bias} = 2^{8-1}-1 = 127$
$\text{biased exponent} = 3+127 = 130 = 10000010$

Therefore, number represented as = 1 10000010 11001000000000000000000

on converting to hexadecimal we get $(C1640000)_{16}$

Correct Answer: $A$

• edited by
13 13 votes

Answer should be option (A). 

5 5 votes
M=14.25=1110.01= 1.11001*2^3

M=11001 MSB 1 is for sign bit , since exponent is 8 bit biased so, 2^8 -1= 127.. E= 127 +3= 130=10000010

So , 1 foe sign bit 10000010(8 bits) for exponent and 1100100000....0(23bits)= C1640000H
4 4 votes
Since No is negative S bit will be 1
Convert 14.25 into binary 1110.01
Normalize it : 1.11001 X 2 ^ 3
Biased Exponent (Add 127) : 3 + 127 = 130 (In binary 10000010)
Mantissa : 110010.....0 (Total 23 bits)

Num represented in IEEE 754 single precision format :

1 10000010 11001000000000000000000

In Hex (Group of Four bits) -

1100 0001 0110 0100 0000 0000 0000 0000

Num becomes : C1640000
Answer:
Position:
Show:

Related questions

48 48 votes
4 answers 4 answers
16.6k
16.6k views
go_editor asked Sep 28, 2014
16,602 views
Consider the equation $(123)_5=(x8)_y$ with $x$ and $y$ as unknown. The number of possible solutions is _____ .
52 52 votes
5 answers 5 answers
18.6k
18.6k views
gatecse asked Aug 5, 2014
18,629 views
The decimal value $0.5$ in IEEE single precision floating point representation hasfraction bits of $000\dots 000$ and exponent value of $0$fraction bits of $000\dots 000$...
37 37 votes
1 answers 1 answer
11.5k
11.5k views
Ishrat Jahan asked Oct 27, 2014
11,469 views
The following bit pattern represents a floating point number in IEEE $754$ single precision format$1 \ 10000011 \ 101000000000000000000000$The value of the number in deci...
72 72 votes
11 answers 11 answers
29.7k
29.7k views
go_editor asked Sep 28, 2014
29,706 views
Let $k=2^n$. A circuit is built by giving the output of an $n$-bit binary counter as input to an $n\text{-to-}2^n$ bit decoder. This circuit is equivalent to a $k$-bit bi...