The GATE Grind

GATE 2020 CS – Question 39

Digital Logic · Number Representation and Floating Point Arithmetic · 2 marks · Multiple choice

Consider three registers R1, R2, and R3 that store numbers in IEEE-754 single precision floating point format. Assume that R1 and R2 contain the values (in hexadecimal notation) 0x42200000 and 0xC1200000, respectively.

If $R3=\frac{R1}{R2}$, what is the value stored in R3?

  1. 0x40800000
  2. 0xC0800000
  3. 0x83400000
  4. 0xC8500000

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) 0xC0800000

Explanation

In single precision, the value is $(-1)^s(1.f)2^{E-127}$ for these normalized operands.

For `0x42200000`, the sign is 0, the exponent is 132, and the fraction gives $1.f=1.25$. Its value is $1.25(2^5)=40$.

For `0xC1200000`, the sign is 1, the exponent is 130, and $1.f=1.25$. Its value is $-1.25(2^3)=-10$.

The quotient is $-4=-1.0(2^2)$. Encoding sign 1, exponent $129$ and fraction zero gives **0xC0800000**.

More Number Representation and Floating Point Arithmetic questions

All Number Representation and Floating Point Arithmetic questions →