The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
2.7k views

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

  1. 400
  2. 500
  3. 600
  4. 700
asked in CO & Architecture by Loyal (4.3k points)
retagged by | 2.7k views

2 Answers

+21 votes
Best answer
Option c. 24 bit = 3 bytes instructions. So PC will have multiples of 3 in it.
answered by Loyal (3.3k points)
selected by
Why would PC increment in steps of Instruction size ?

1. Shouldn't program counter increment in steps of word size ?

2. In CISC machine instructions are not of uniform length, the question does not mention uniform instruction length. so what if few instructions were of few of only two bytes ?
Aren't you reading the question? It says "24 bit" instructions. And PC always increments in instruction size as it is nothing but pointer to instructions.
+8 votes

C) is the ans

size of instruction  =  24/8 = 3 bytes.

Program Counter can shift 3 bytes at a time to jump to next instruction.

So the given options must be divisible by 3. only 600 is satisfied.

answered by Loyal (4.1k points)
Can you explain  why you divided 24 by 8?
Converting bit to byte and as a instruction size is 3 bytes each,program counter will shift 3 bytes each time so address will be multiple of 3.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

33,593 questions
40,128 answers
114,021 comments
38,389 users