Question
A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?
ADD R1, #25 // R1 = R1 + 25Official answer and solution
- Official answer
- B
- From
- Official GATE 2025 answer key
Solution
Subtract the minimum bits needed for the opcode and the single register field R1 from the 32-bit instruction length.
- Opcode field: To encode distinct instruction types, we need bits ().
- Register field (
R1): To address general-purpose registers, we need bits. - Immediate operand field (
#25): Since the instructionADD R1, #25specifies only one register (R1, which serves as both source and destination) and one immediate operand, the maximum number of bits left for the immediate operand is:
Option (B)
Subtracting two 6-bit register fields () when the instruction encoding only specifies a single register R1.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 37 of 65
- 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.