GATE / CS ARCHIVE

GATE CSE 2024 SET 2 / QUESTION 61

Account for a type tag and register fields

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 2024 Set 2 paper

GATE 2024 Set 2, Q61 2 marks · NAT
Report issue

Instructions & Addressing Modes

Question 61, GATE 2024: A 32-bit ISA has 150 instructions, 75 each of R-type and I-type, and 50 registers. OPCODE includes a 1-bit type tag plus operation bits. R-type fields: OPCODE, UNUSED, DST, SRC1, SRC2. I-type: OPCODE, DST, SRC, immediate/address. Equal-sized register fields are used. If UNUSED, OPCODE and immediate/address sizes are X,Y,Z, find X+2Y+Z.
Tap to enlarge
Answer & solution

Official answer: 34

Approach: Count the operation bits within each type, add the type bit, then subtract register fields from each format.

1. Derivation. There are 75 operations per instruction type, requiring 7 operation bits plus the 1-bit type tag, so Y=8. Each of 50 architectural registers requires 6 bits. The R-type unused field has X=32−8−3×6=6 bits; the I-type immediate field has Z=32−8−2×6=12 bits. Hence X+2Y+Z=6+16+12=34.

2. Explanation and checks. Six bits encode only 64 operations, insufficient for 75, so seven operation bits are necessary. The one-bit type discriminator brings the full opcode width to eight. Similarly five register bits encode only 32 names, while six accommodate 50. The R-type equation is X+Y+18=32 and the I-type equation is Y+12+Z=32. Adding those equations directly gives X+2Y+Z=64−30=34, which independently checks the field-by-field calculation.

Original paper, page 39 · Answer key