in CO and Architecture edited by
15,844 views
41 votes
41 votes

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$
in CO and Architecture edited by
15.8k views

11 Answers

44 votes
44 votes
Best answer
Option $(C)$. $24$ bits = $3$ bytes instructions. So, PC will have multiples of $3$ in it.
edited by
by

4 Comments

CPU is byte addressable always if not given
0
0
bit addressable naya aya hh kya market me? 😁
0
0


There is nothing as bit addressable!

0
0
13 votes
13 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.

2 Comments

Can you explain  why you divided 24 by 8?
0
0
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.
1
1
2 votes
2 votes

As given in the question, the instruction is 24 bits, so if you convert the instruction length in terms of bytes it will be 3 Bytes because 8 bits = 1 Byte, So 24 Bits = 24/8 => 3 Bytes.

Given that the starting address of the program in the memory is 300, initially program counter (PC) will contain the value of 300.

300-----302                                                                                                                                                                                      

Starting Address Ending Address
300 302
303 305
306 308
309 311
......... ........
......... ........
......... ........
597 599
600 602

The valid value of Program counter will be 600.

edited by

2 Comments

Please explain:

1] Is the memory always Byte addressable? That's why you are converting bit to byte?

2] Also, If PC starts at 300, will it go like 300, 301, 302, 303.... or 300, 303, 306.... ?
0
0
1.) If it is not mentioned , then you have to consider the memory as byte addressable otherwise word size will be explicitly mentioned in the question.

2.) No, the step size of Program Counter  is 3 Bytes. It will go like 300 -> 303 ->306........600.
1
1
2 votes
2 votes
Here, 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.
by
Answer:

Related questions