Skip to content
GATEiit

GATE CSE 2020 Q54: Maximum R-type opcodes with expanding opcodes in a 16-bit format

Question

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 _______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 14 (official GATE 2020 final answer key)

Concept used: Expanding opcodes: unused patterns of the shorter opcode field are extended into longer opcodes.

First step: A register name is 6 bits, so the I-type opcode is 16−6−4=616 - 6 - 4 = 6 bits and the R-type opcode is 16−12=416 - 12 = 4 bits. Count the 6-bit patterns left after the 8 I-type opcodes.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2020 CS question paper and final answer key, organised by IIT Delhi. Question paper · Answer key