Question
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 , what is the value stored in R3?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2020 answer key
Solution
Decode the IEEE-754 single precision floating point numbers, perform the division, and re-encode the result.
Decode R1 (0x42200000):
- In binary:
0 10000100 01000000000000000000000 - Sign bit: (positive)
- Biased exponent: Unbiased exponent
- Mantissa:
- Value:
Decode R2 (0xC1200000):
- In binary:
1 10000010 01000000000000000000000 - Sign bit: (negative)
- Biased exponent: Unbiased exponent
- Mantissa:
- Value:
Perform division:
Encode into IEEE-754 single precision format:
- Sign bit: (since number is negative)
- Magnitude:
- Biased exponent:
- Fraction field: 23 zeros ()
- Combined 32-bit word:
1 10000001 00000000000000000000000 - Hexadecimal:
1100 0000 1000 0000 0000 0000 0000 0000=0xC0800000.
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2020 Computer Science and Information Technology (CS)
- Question
- 39 of 65, printed as CS Q.29
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.