in CO and Architecture
619 views
1 vote
1 vote
Consider a hypothetical CPU which supports 16-bit instruction, 64 registers and 1 KB memory space. If there exist 12 2-address instructions which use register references and 12 1-address memory reference instructions then how many 0-address instructions are possible?
in CO and Architecture
by
619 views

1 comment

I think question is not well framed.
0
0

2 Answers

4 votes
4 votes
Best answer

Total number of possible instruction encoding = 2^16

This CPU has three type of instructions

Number of possible instruction encoding for Type I (2 address instruction)= 12 * 2^6 * 2^6

Number of possible instruction encoding for Type II (1 address instruction)= 12 * 2^10

Let number of possible instruction encoding for Type III (0 address instruction) be x

Since , Type I+ type II+ Type III= 2^16

=> 12 * 2^6 * 2^6 + 12 * 2^10 + x = 2^16

=> x = 4096

Number of zero address instruction possible = 4096

 

selected by
3 votes
3 votes

Correct answer: 4096 0-address instructions.

 

1 comment

I got the same answer and I believe it’s the correct one. However, it confused me because the answer key has this solution:

IMO, the mistake they made here is taking 5 bits for the register field and 11 bits for memory.

2
2

Related questions