Skip to content
Official PYQ · 2025

GATE CS 2025 Set 1 Q27 — Machine Instructions and Addressing Modes

Explain with AI

A processor has 6464 general-purpose registers and 5050 distinct instruction types. An instruction is encoded in 3232-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?

ADD R1\text{ADD R1}, #25\#25  / /  R 1=R 1+25\text{R 1=R 1+25}

Choose one option
View worked solution

Answer: B

To find the maximum number of bits available for the immediate operand, we analyze the fields of the instruction format based on the given example ADD R1, #25:

  • Opcode Field: There are 5050 distinct instruction types. The number of bits required for the opcode is: ⌈log⁡2(50)⌉=6 bits\lceil \log_2(50) \rceil = 6\text{ bits}
  • Register Field: There are 6464 general-purpose registers. The number of bits required to address one register is: log⁡2(64)=6 bits\log_2(64) = 6\text{ bits}
  • Immediate Operand Field: Let this require xx bits.

The total instruction length is 3232 bits. Since the instruction ADD R1, #25 references only one register (R1R1 acts as both source and destination) and one immediate value, we have:

Opcode bits+Register bits+Immediate bits≤32\text{Opcode bits} + \text{Register bits} + \text{Immediate bits} \le 32 6+6+x≤326 + 6 + x \le 32 12+x≤32  ⟹  x≤2012 + x \le 32 \implies x \le 20

Thus, the maximum number of bits that can be used for the immediate operand is 2020.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions