retagged by
335 views
0 votes
0 votes
Consider a hypothetical processor that supports two address, one address and zero address instructions. It has a $256$ word memory, and a $20$ bit instruction is placed in $1$ word of memory (memory is word addressable). Given that there exist $8$ two address instructions and $1984$ one address instructions. The total number of zero address instructions formulated is ________ (put in integers only)
retagged by

1 Answer

Best answer
3 votes
3 votes

It is given , 20 bit instruction is placed in 1 word of memory .

And we have 256 word memory , 256 = 28 so  8 bits for 1 address, 8 bits for 2 address and 20 - (8+8) =4 bits for opcode.

opcode = 4 bits 
 add1= 8 bits
 add2 = 8 bits

Given that there exist 8 two address instructions and 1984 one address instructions

with 20 bits , possible encoding is 220 .

No. of encoding for 2 address instructions = 8 *  28 * 28 = 219   bcoz two 8-bit address fields .

No. of encoding for 1 address instructions = 1984 *  28  bcoz one 8-bit address fields

So, number of possible 0-address instructions = 220 -  219 - ( 1984 *  28 )

= 524288 -  507904

= 16384

Now possible 0-address instructions  = 16384  .

selected by
Answer:

Related questions