Skip to main content

GATE CSE 2026CO & Architecture › Machine Instructions & Addressing ModesVerified

GATE CSE 2026 PYQ: Consider a processor that has 16 16 16 general purpose registers and it uses 2 2 2 -byte instruction format…

Consider a processor that has 16 general purpose registers and it uses 2-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has 2 register operands and a 6-bit immediate operand. Each Rtype instruction has 3 register operands. Each C-type instruction has a register operand and a 6 -bit offset value. If there are 2 unique M-type opcodes and 7 unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?

  1. A
    8
  2. B
    4
    Correct answer
  3. C
    64
  4. D
    16

Answer

(B) 4 4 4

Approach

Compute register field width, then apply variable-length opcode expansion. M-type consumes two of the four 2-bit opcodes, leaving two 2-bit prefixes. R-type extends one or more of those prefixes; the unused R-type 4-bit opcode can be further extended to produce C-type 6-bit opcodes.

Using variable-length opcodes, M-type uses 2 of 4 two-bit opcodes, R-type uses 7 of the 8 possible four-bit opcodes, leaving exactly one four-bit opcode. Extending that one leftover opcode by 2 bits yields $2^2 = 4 C-type$ opcodes. Hence option B is correct.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.