GateAI
Instruction Set and Addressing Modes

GATE CSE 2024 Set 2 · Q61

NAT2 marksMedium

Time

A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below. R-type Instruction Format: I-type Instruction Format: In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size. Let XX be the number of bits used to encode the UNUSED field, YY be the number of bits used to encode the OPCODE field, and ZZ be the number of bits used to encode the immediate value/address field. The value of X+2Y+ZX + 2Y + Z is _________

GATE CSE 2024 Set 2 Q61 diagram 1
GATE CSE 2024 Set 2 Q61 diagram 2

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 34

Instruction Set and Addressing Modes
  1. OPCODE Field (YY):

    • There are 150 instructions, equally divided into R-type (75 instructions) and I-type (75 instructions).

    • 1 bit distinguishes between the two types.

    • The remaining bits must uniquely identify 75 operations: ⌈log⁡2(75)⌉=7\lceil \log_2(75) \rceil = 7 bits.

    • Total bits in the OPCODE field: Y=1+7=8Y = 1 + 7 = 8 bits.

  2. Register Fields:

    • The processor has 50 architectural registers.

    • Each register field requires: ⌈log⁡2(50)⌉=6\lceil \log_2(50) \rceil = 6 bits.

  3. UNUSED Field (XX) in R-type Instruction:

    • Total instruction size = 32 bits.

    • R-type contains: OPCODE+UNUSED+3×(Register fields)=32\text{OPCODE} + \text{UNUSED} + 3 \times (\text{Register fields}) = 32

    • 8+X+3×6=32  ⟹  8+X+18=32  ⟹  X=68 + X + 3 \times 6 = 32 \implies 8 + X + 18 = 32 \implies X = 6 bits.

  4. Immediate/Address Field (ZZ) in I-type Instruction:

    • I-type contains: OPCODE+2×(Register fields)+Immediate/Address=32\text{OPCODE} + 2 \times (\text{Register fields}) + \text{Immediate/Address} = 32

    • 8+2×6+Z=32  ⟹  8+12+Z=32  ⟹  Z=128 + 2 \times 6 + Z = 32 \implies 8 + 12 + Z = 32 \implies Z = 12 bits.

  5. Calculate X+2Y+ZX + 2Y + Z:

    X+2Y+Z=6+2(8)+12=6+16+12=34X + 2Y + Z = 6 + 2(8) + 12 = 6 + 16 + 12 = 34

Thus, the correct answer is 34.

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 Q61 of the GATE CSE 2024 Set 2 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 GATE CSE 2024 Set 2 has 2.

How GATE tests Instruction Set and Addressing Modes

More from GATE CSE 2024 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2024 Set 2 · Q61 · NAT

A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below. R-type Instruction Format: I-type Instruction Format: In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size. Let X be the number of bits used to encode the UNUSED field, Y be the number of bits used to encode the OPCODE field, and Z be the number of bits used to encode the immediate value/address field. The value of X + 2Y + Z 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.