GateAI
Instruction Set and Addressing Modes

GATE CSE 2020 · Q44

NAT2 marksMedium

Time

A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is _________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 14

Instruction Set and Addressing Modes

### 1. Register Address Bits: Number of registers = 64=2664 = 2^6, so 6 bits are required to specify a register.

### 2. Instruction Formats (16 bits total):

  • I-type instruction format:

    • Register: 6 bits

    • Immediate value: 4 bits

    • Opcode field size for I-type: 16−(6+4)=616 - (6 + 4) = 6 bits

    • Total available bit combinations for I-type opcode field: 26=642^6 = 64

    • Given number of distinct I-type opcodes: 88

    • Unused patterns in the I-type opcode field: 64−8=5664 - 8 = 56

  • R-type instruction format:

    • Register 1: 6 bits

    • Register 2: 6 bits

    • Opcode field size for R-type: 16−(6+6)=416 - (6 + 6) = 4 bits

### 3. Expanding Opcode Analysis: Notice that the I-type opcode field is 6 bits, while the R-type opcode field is 4 bits. Since the 4-bit prefix of the instruction determines whether it can be expanded into R-type instructions:

  • Each unused 6-bit I-type opcode pattern can be used for R-type only if we look at prefix overlaps, or more precisely: Let kk be the number of 4-bit patterns allocated to R-type instructions. Then 16−k16 - k patterns of length 4 are available to expand into 6-bit I-type opcodes. Each such 4-bit pattern yields 26−4=22=42^{6-4} = 2^2 = 4 distinct 6-bit opcodes. Therefore, the total number of I-type opcodes possible is:

    (16−k)×4(16 - k) \times 4

Given that there are 8 distinct I-type opcodes:

(16−k)×4≥8  ⟹  16−k≥2  ⟹  k≤14(16 - k) \times 4 \ge 8 \implies 16 - k \ge 2 \implies k \le 14

Thus, the maximum number of distinct 4-bit R-type opcodes is 14.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Instruction Set and Addressing Modes previous year question is Q44 of the GATE CSE 2020 paper. Find more GATE CSE PYQs on Instruction Set and Addressing Modes in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Instruction Set and Addressing Modes PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Instruction Set and Addressing Modes in GATE CSE

Instruction Set and Addressing Modes has 19 GATE CSE PYQs across 15 papers from 2011 to 2026. 6 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2020.

How GATE tests Instruction Set and Addressing Modes

More from GATE CSE 2020

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2020 · Q44 · NAT

A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is …

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.