724 views

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$

### Subscribe to GO Classes for GATE CSE 2022

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

by
2

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.

by
35 104 555

1
1,084 views
1 vote