in CO and Architecture retagged by
743 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}$
in CO and Architecture retagged by
743 views

2 Comments

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

 

0
0

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$

All India Mock Test 4 - Solutions Part 1

0
0

2 Answers

11 votes
11 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.\]

---

edited by

2 Comments

how did you get 1000 for 2^(-20) ?
0
0

2^(-20)= 0000 0000 0000 0000 0001 000 (23 bits for single point representation for mantissa).

When representing fractional part in binary,we move towards the right.

0
0
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

3 Comments

bias is calculated by using the formula: 2(n-1) – 1

here n = 8

so bias should be 27-1 = 127

why you have taken 126 as your bias?

And by taking bias as 127, answer is coming out to be option C

0
0

@rishabh-441

in normalized form we take bias as 127 is true

but here it is the case of denormalized form so it is by definition $0.frac\times2^{-126}$ it is defined like that

by using normalized form we cant represent numbers smaller that $2^{-126}$(by magnitude)

Denormalized

If the exponent is all zeros, but the mantissa is not (else it would be interpreted as zero), then the value is a denormalized number, which does not have an assumed leading one before the binary point. Thus, this represents a number (-1)^s x 0.m x 2^-126, where s is the sign bit and m is the stored mantissa. From this you can interpret zero as a special type of denormalized number.

you can find it in the referenced provided

in the usual normalized form if you conside bias $-147+127=-20$  but you can represent onky numbers from 0-255 in the unsigned 8 bit efponent field so it is not possible to use normalized form

1
1
Answer:

Related questions