Skip to content
Official PYQ · 2006

GATE CS 2006 Q09 — Machine Instructions and Addressing Modes

Explain with AI

A CPU has 2424-bitbit instructions. A program starts at address 300300 (in decimal). Which one of the following is a legal program counter (all values in decimal)?

Choose one option
View worked solution

Answer: C

Assuming the memory is byte-addressable (which is the standard default for such problems):

  • The instruction size is 24 bits=248=3 bytes24\text{ bits} = \frac{24}{8} = 3\text{ bytes}.
  • Since each instruction is 3 bytes3\text{ bytes} long, the Program Counter (PC) must advance by multiples of 33 bytes for each subsequent instruction.

Given that the program starts at address 300300, any legal PC value must be of the form:

PC=300+3kwhere k∈Z≥0\text{PC} = 300 + 3k \quad \text{where } k \in \mathbb{Z}_{\ge 0}

This implies that (PC−300)(\text{PC} - 300) must be perfectly divisible by 33. Let's test the given options:

  • Option A (400): 400−300=100400 - 300 = 100, which is not divisible by 33.
  • Option B (500): 500−300=200500 - 300 = 200, which is not divisible by 33.
  • Option C (600): 600−300=300600 - 300 = 300, which is divisible by 33 (300=3×100300 = 3 \times 100). This is a legal PC address.
  • Option D (700): 700−300=400700 - 300 = 400, which is not divisible by 33.

Hence, 600 is the only legal program counter value among the choices.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions