644 views
1 votes
1 votes
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?

2 Answers

Best answer
4 votes
4 votes

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.

 

Related questions

2 votes
2 votes
0 answers
1