in Digital Logic edited by
531 views
5 votes
5 votes

According to the IEEE standard, a 32-bit, single-precision, floating-point number $N$ is defined to be
$$
N=(-1)^S \times 1 . F \times 2^{E-127}
$$
where $S$ is the sign bit, $F$ the fractional mantissa, and $E$ the biased exponent.

A floating-point number is stored as $S: E: F$, where $S, E$, and $F$ are stored in $1$ bit, $8$ bits, and $23$ bits, respectively.

What is the largest finite positive value that can be stored using a single precision float?

  1. $\left(1-2^{-23}\right) * 2^{127}$
  2. $\left(1+\left(1-2^{-23}\right)\right) * 2^{127}$
  3. $\left(1-2^{-23}\right) * 2^{128}$
  4. $\left(1+\left(1-2^{-23}\right)\right) * 2^{128}$
in Digital Logic edited by
531 views

2 Answers

11 votes
11 votes
The standard followed by IEEE-754 for single precision is:

$\begin{array}{|l|l|l|} \hline \text { Sign bit (1 bit) } & \text { Exponent bit (8 bit) } & \text { Mantissa (23 bit) } \\ \hline \end{array}$

which is the same as what is mentioned in the question.

IEEE-754 follows implicit normalization where ($E$ is the biased exponent) $E \neq 00 \ldots 0$ and $E \neq 111 \ldots 1$, i.e., exponents all zero's and all 1's are not allowed while the mantissa can be anything ($M = X X \ldots X$).

Now, we are asked to find the largest finite positive value so:

$S=0$ (for positive)

$\mathrm{E}=11111110$ (as all 1's not allowed, i.e., 254 in decimal)

$\mathrm{M}=1111 \ldots 1$ (all 1's as no constraint on the mantissa part)

Let $e$ be the original exponent.

$\mathrm{E}$ (biased exponent) $= e +$ bias (for single precision in IEEE-754 bias $= 127$)

so, $e = 254 - 127 = 127$

Value $= (-1)^0 \times (1.11111111111111111111111) \times 2^{127}$

$= 111111111111111111111111 \times 2^{-23} \times 2^{127}$

$= (2^{24} - 1) \times 2^{-23} \times 2^{127}$

$= (2 - 2^{-23}) \times 2^{127}$

$= (1 + (1 - 2^{-23})) \times 2^{127}$

Hence, Option B is correct.
edited by
0 votes
0 votes
How to solve this question??
Answer:

Related questions