retagged by
8,465 views
7 votes
7 votes

Consider three floating point numbers $\textit{A, B}$ and $\textit{C}$ stored in registers $\text{R}_{\text{A}}, \text{R}_{\text{B}}$ and $\text{R}_{\text{C}},$ respectively as per $\textsf{IEEE-754}$ single precision floating point format. The $\text{32-bit}$ content stored in these registers $\text{(in hexadecimal form)}$ are as follows.

$\begin{array} {|c|c|c|} \hline \text{R}_{\text{A}} = \text{0xC1400000} & \text{R}_{\text{B}} = \text{0x42100000} & \text{R}_{\text{C}} = \text{0x41400000} \\\hline \end{array}$

Which one of the following is $\text{FALSE}?$

  1. $\textit{A + C} = 0$
  2. $\textit{C = A + B}$
  3. $\textit{B =3C}$
  4. $\textit{(B – C)} > 0$
retagged by

3 Answers

16 votes
16 votes

Here, option B is the right answer. See the image attched below:

7 votes
7 votes

Given that Numbers are in IEEE-754 single precision.

Representation :: $\text{1 sign bit, 8 exponent bits and 23 Mantissa Bits}$

$\text{Decimal value} = (-1)^{\text{Sign bit}}\times(1.Mantissa)\times(2)^{exponent-127}$

 

$R_A = 0xC1400000 = 1100 \;0001\;0100 \; 0000\; 0000\; 0000\; 0000\; 0000$

$R_A = 0xC1400000 = \underbrace{1}\underbrace{100 \;0001\;0}\underbrace{100 \; 0000\; 0000\; 0000\; 0000\; 0000}$

$\text{Decimal value of R}_A = (-1)^{\text{1}}\times(1.1000000000..)\times(2)^{130-127}=-(1100)_2 = -12$

 

$R_B = 0x42100000 = 0100 \;0010\;0001 \; 0000\; 0000\; 0000\; 0000\; 0000$

$R_B = 0x42100000 = \underbrace{0}\underbrace{100 \;0010\;0}\underbrace{001 \; 0000\; 0000\; 0000\; 0000\; 0000}$

$\text{Decimal value of R}_B = (-1)^{\text{0}}\times(1.001000000000..)\times(2)^{132-127}=-(100100)_2 = 36$

 

$R_C = 0x41400000 = 0100 \;0001\;0100 \; 0000\; 0000\; 0000\; 0000\; 0000$

$R_C = 0x41400000 = \underbrace{0}\underbrace{100 \;0001\;0}\underbrace{100 \; 0000\; 0000\; 0000\; 0000\; 0000}$

$\text{Decimal value of R}_C= (-1)^{\text{0}}\times(1.1000000000..)\times(2)^{130-127}=(1100)_2 = 12$

 

$\therefore C=A+B\;\; is\; false.$

 

Alternate :

$R_A = 0xC1400000, R_B = 0x42100000 \;\;and\;\; R_C = 0x41400000$

  1. By observing $R_A$ and $R_C$ only MSB bit is different ===> $R_C$ = -$R_A$ ===> $R_C$ + $R_A$ = 0
  2. By observing $R_B$ and $R_C$, $R_B$ exponent part is higher than $R_C$ exponent part ===> $R_B$ > $R_C$ ===> $R_B$ - $R_C$ > 0

 

Now Verify other two options.

1 votes
1 votes
For conceptual & practice purpose, it is good to solve in procedural way. But in exam this question was not meant to be solved in procedural way.

If we observe carefully, A & C are only differ in sign.

So, let A = -x & C = +x.

This makes option A true & B false. Solution ends here.
Answer:

Related questions

1 votes
1 votes
3 answers
3
1 votes
1 votes
3 answers
4