A CPU has - instructions. A program starts at address (in decimal). Which one of the following is a legal program counter (all values in decimal)?
View worked solution
Answer: C
Assuming the memory is byte-addressable (which is the standard default for such problems):
- The instruction size is .
- Since each instruction is long, the Program Counter (PC) must advance by multiples of bytes for each subsequent instruction.
Given that the program starts at address , any legal PC value must be of the form:
This implies that must be perfectly divisible by . Let's test the given options:
- Option A (400): , which is not divisible by .
- Option B (500): , which is not divisible by .
- Option C (600): , which is divisible by (). This is a legal PC address.
- Option D (700): , which is not divisible by .
Hence, 600 is the only legal program counter value among the choices.
Free practice · Your answers on this page are not saved.
