The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+24 votes
In an $11-bit$ computer instruction format, the size of address field is $4-bits.$ The computer uses expanding OP code technique and has $5$ two-address instructions and $32$ one-address instructions. The number of zero-address instructions it can support is ________
asked in CO & Architecture by Veteran (52k points)
retagged by | 2.4k views

2 Answers

+37 votes
Best answer
No. of possible instruction encoding $=2^{11} = 2048$

No. of encoding taken by two-address instructions $=5 \times 2^4 \times 2^4 = 1280$

No. of encoding taken by one-address instructions $=32 \times 2^4 = 512$

So, no. of possible zero-address instructions $=2048 - (1280 + 512) = 256$
answered by Veteran (407k points)
selected by
what is the logic behind the calculation of no. of 2 address and 3 address instructions ?

@arjun sir @habibkhan

Could you generalize this concept for all  the problems because by using this method I am unable to find out the answer to all the questions .

Plz see this.


Start at 07:32

+6 votes
Out of 11 bits, 3 bits are for opcode in 2-Address. So 2^3=8 instructions(2-Address) are possible.

But 5 are being used. So 3 are free.

We use these 3 for 1-address instruction by using 4 bits of 1 of the addresses i.e. 3*16=48

Now out of 48 1-address instructions, 32 are being used. So we are left with 16.

Again use these 16 for 0-address instruction by using 4 bits of address i.e. 16*16=256
answered by Junior (833 points)
why have you done 16*16, can you explain this in more detail

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,535 questions
54,117 answers
71,028 users