GATE 2025 CS (CS1) – Question 37
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 + 25
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) 20
Explanation
The opcode needs ceil(log2 50) = 6 bits and the single register operand needs log2 64 = 6 bits. That leaves 32-6-6 = 20 bits for the immediate.