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?
, / /
GATE CSE 2025CO & Architecture › Machine Instructions & Addressing ModesVerified
GATE CSE 2025 PYQ: A processor has 64 64 64 general-purpose registers and 50 50 50 distinct instruction types. An instruction…
- A16
- B20Correct answer
- C22
- D24
Answer
(B) 20 20 20
Approach
The instruction format must allocate enough bits to identify the opcode and the register operand; the remaining bits can be used for the immediate value. For ADD R1, #25, one register is explicitly referenced, so the fields are opcode, register, and immediate.
The maximum immediate operand size is determined by subtracting the opcode and register fields from the 32-bit instruction length: $32 - \lceil \log_2 50 \rceil - \lceil \log_2 64 \rceil = 32 - 6 - 6 = 20$ bits.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.