in CO and Architecture edited by
377 views
1 vote
1 vote
In a 16 bit computer instruction format, the size of address field is 5 bits. The computer uses expanding opcode technique. It has two 2-address instructions and 1024 one address instruction. How many zeroaddress instruction can be formulated?
in CO and Architecture edited by
377 views

1 comment

216 - (2 * 25 * 25 + 1024 * 25) = 65536 - (2048 + 32768) = 30720 zero address instructions.

0
0

1 Answer

2 votes
2 votes

Total $\#$ of 2 address instruction  = $2^{16-5-5}=2^{6}=32$

Free instructions = $64-2=62$ 

Total $\#$ of 1 address instruction = $62 \times 2^5 = 1984$

Free instructions = $1984-1024 = 960$

Total $\#$ of 0 address instruction = $960 \times 2^{5}=\color{RED}{30720}$


Another approach

Total encoding with $16$  bits = $2^{16}$

$2$ address encoding = $2\times 2^5\times 2^5=2^{11}$

$1$ address encoding = $1024 \times 2^{5}=2^{15}$


Remaining encodings $=\  0$ address encoding = $2^{16}- 2^{15} -2^{11}$

$=65536-32768-2048=\color{REd}{30720}$ 

1 comment

Typo 

 

Total ## of 2 address instruction  = 216−5−5=26=32

0
0

Related questions