GateAI
Instruction Set and Addressing Modes

GATE CSE 2016 Set 2 · Q31

NAT2 marksEasy

Time

Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes) consumed by the program text is _______.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 500

Instruction Set and Addressing Modes

To find the size of each instruction, we calculate the number of bits required for each field:

  1. Opcode: For 12 instructions, bits needed = ⌈log⁡212⌉=4 bits\lceil \log_2 12 \rceil = 4\text{ bits}.

  2. Source Register 1: For 64 registers, bits needed = ⌈log⁡264⌉=6 bits\lceil \log_2 64 \rceil = 6\text{ bits}.

  3. Source Register 2: Bits needed = ⌈log⁡264⌉=6 bits\lceil \log_2 64 \rceil = 6\text{ bits}.

  4. Destination Register: Bits needed = ⌈log⁡264⌉=6 bits\lceil \log_2 64 \rceil = 6\text{ bits}.

  5. Immediate Value: Given as 12 bits12\text{ bits}.

Total bits per instruction:

Total bits=4+6+6+6+12=34 bits\text{Total bits} = 4 + 6 + 6 + 6 + 12 = 34\text{ bits}

Since instructions must be stored in a byte-aligned fashion (multiples of 8 bits / 1 byte):

Bytes per instruction=⌈348⌉=5 bytes\text{Bytes per instruction} = \left\lceil \frac{34}{8} \right\rceil = 5\text{ bytes}

For a program of 100 instructions:

Total memory consumed=100×5 bytes=500 bytes\text{Total memory consumed} = 100 \times 5\text{ bytes} = 500\text{ bytes}

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

How GATE tests Instruction Set and Addressing Modes

More from GATE CSE 2016 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2016 Set 2 · Q31 · NAT

Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes) consumed by the program text 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.