retagged by
871 views
9 votes
9 votes

Suppose we use $\textsf{IEEE-754}$ single precision floating point format to represent the numbers in binary. What will be the hexadecimal representation of $-2^{-146}?$

  1. $\textsf{0x80000004}$
  2. $\textsf{0x80000008}$
  3. $\textsf{0x80000010}$
  4. $\textsf{0x80000002}$
retagged by

2 Answers

12 votes
12 votes

The original question can be found at the following source: Berkeley PDF, Page 2, Q2.

 

Considering \(2^{-146} < 2^{-126},\) we are dealing with a denormalized number.

Important Note:There are two formulas applicable for IEEE 754 Single Precision –

\[
\begin{array}{c}
\text{1. Formula for Normalized Numbers:}
\end{array}
\]
\[
\color{red}
\begin{equation}
(-1)^{\text{sign}} \times 1.\text{significand} \times 2^{\text{Stored Exponent} - 127}
\end{equation}
\]
\[
\begin{array}{c}
\text{2. Formula for Denormalized Numbers:}
\end{array}
\]
\[
\color{red}
\begin{equation}
(-1)^{\text{sign}} \times 0.\text{significand} \times 2^{-126}
\end{equation}
\]

Given the magnitude of the number \(-2^{-146},\) it falls within the denormalized category. In mathematical terms, if the magnitude of a number is strictly less than \(2^{-126},\) it is classified as a denormalized number.

Now, let's explore the significance of \(2^{-126}.\)
Why we are fixing \(2^{-126} \) for denorms ?
 

To answer this, consider the least positive number storable in normalized form.

Formula for Normalized Numbers: \[(-1)^{\text{sign}} \times 1.\text{significand} \times 2^{\text{Stored Exponent} - 127}.\]

For the least positive normalized number:
- Sign = 0 (positive)
- Significand (or mantissa or fraction) = all zeros
- Stored Exponent should be the least but cannot be all zeros (normalized numbers cannot have all zeros or all ones); hence, it should be 0000 0001.

Therefore, the least positive normalized number is EXACTLY equal to  \(2^{-126}.\) It is the boundary where normalized numbers ends, and denormalized numbers starts. (jaha normalized ki range khatam hoti h waha se denomalralised ki boundary shuru hoti h.)

Hence, "-126" is a clever choice for denormalized numbers.

Formula for Denormalized Numbers: \[(-1)^{\text{sign}} \times 0.\text{significand} \times 2^{-126}.\]

The number we aim to store is: $ -2^{-146} $.

\[ -2^{-146} = - 2^{-20} \times 2^{-126} \]  \[ -2^{-146} = - 2^{-20} \times 2^{-126} = (-1)^{1} \times2^{-20} \times 2^{-126}\]
\[= (-1)^{1} \times 0.000...01000 \times 2^{-126}.\]

\[
\begin{array}{|l|l|l|}
\hline \text{sign} & \text{exponent} & \text{mantissa} \\
\hline
\end{array}
\]

\[ \text{sign} = 1 \text{ (negative number)},\]
\[ \text{exponent} = 0 \text{ (for denormalized numbers)},\]
\[ \text{mantissa} = 000...01000 \text{ (for } 2^{-20}  ).\]

\[ \text{Putting it all together:} \quad \begin{array}{|l|l|l|} \hline \text{1} & \text{00..000} & \text{000...01000} \\ \hline \end{array} \]

\[0\text{x}80000008.\]

---

5 votes
5 votes

This is talking about the IEEE 754 denormalized form

in denormalized form we write number as $+/-0.frac\times 2^{-126}$ with the exponent being all 0s

146-126=20 so 1 will be at $20^{th}$ position

that is given number can be written as $-0.0000$ $0000$ $0000$ $0000$ $0001$ $000\times2^{-126}$

in IEEE 754 we have

sign (1 bit) exponent (8 bits)

fraction (23 bit)

 

given number can be represented as

1 000 0000 0 000 0000 0000 0000 0000 1000

 

$0x80000008$

denormalized form help in representing really small number without using more bits other form of representation forms

there are other special numbers in IEEE 754 standard for NaN and $+/-\infty$

 

IEEE Standard for Binary Floating-Point Arithmetic

wikipedia IEEE_754-1985

https://courses.cs.washington.edu/courses/cse401/01au/details/fp.html

http://li.mit.edu/Archive/Activities/Archive/CourseWork/Ju_Li/MITCourses/18.335/Doc/IEEE754/ieee754.pdf

 

edited by
Answer:

Related questions

5 votes
5 votes
1 answer
2