GATE / CS ARCHIVE

GATE CSE 2025 SET 1 / QUESTION 37

Allocating bits in an instruction format

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 2025 Set 1 paper

GATE 2025 Set 1, Q37 2 marks · MCQ
Report issue

Instructions & Addressing Modes

Question 37, GATE 2025: A processor has 64 general-purpose registers, 50 instruction types, and fixed 32-bit instructions. For ADD R1,#25, meaning R1=R1+25, what is the maximum immediate field width in the conventional fixed-width opcode/register-field model? A 16; B 20; C 22; D 24 bits.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Approach: Reserve the minimum bits needed for the opcode and the explicitly encoded register, then assign the remainder to the immediate.
There must be at least 50 opcode patterns. Five bits provide only 32 patterns, while six provide 64, so the opcode requires ceil(log₂50)=6 bits. Selecting among 64 registers requires log₂64=6 bits.
This two-address instruction uses R1 both as a source and as the destination; the same register is encoded once, not in two independent fields. Thus the immediate can occupy 32−6−6=20 bits, option B.
The calculation assumes a uniform opcode field and no additional mode or reserved fields, as intended by the question. A 16-bit immediate would leave unused capacity under those assumptions, while 22 or 24 bits would not leave enough room for both required fields. An instruction-set design with variable-length opcodes would need additional specification before such a maximum could be established.

Original paper, page 37 · Answer key