in CO and Architecture retagged by
11,763 views
12 votes
12 votes
A computer uses expanding opcode. It has 16 bit instructions 6 bit addresses, it supports one address, two address instructions only. If there are n two address instructions, the maximum number of one address instructions are?
in CO and Architecture retagged by
by
11.8k views

3 Answers

24 votes
24 votes
Best answer

We have 16 bits for instructions- no. of encoding = $2^{16}$

Since, 6 bit addresses are used, and we have $n$ two address instructions it would take $2^6 \times 2^6 \times n$ encoding.

Given, only one address and two address instructions are present. So, all remaining encoding can be used for one address instructions which will be $2^{16} - 2^{12} \times n$ which will correspond to $\left(2^{16} - 2^{12} \times n \right) /2^6 = 2^{10} - n \times 2^6 $ one address instructions as address field needs $2^6$ bits. 

http://www.personal.kent.edu/~aguercio/CS35101Slides/Tanenbaum/CA_Ch05_PartII.pdf

selected by
by

11 Comments

Sir,why till 2^16-2^12*n ok...why division by 2^6?Plz xplain
0
0
u have two remove address bits.
0
0
Sorry didn't get you..remove bits?
0
0
We found the total number of encodings which can be used for 1 address instructions. But each one address instruction will have 6 address bits and changing the address bits won't change the instruction count. So, we divide by $2^6$ to account for this. For 2 address we would have divided by $2^{12}$ and for zero address no division required.
6
6
Thanks Sir!!I got ur explaination...But how it has been take care for 2 address instructions ,I didn't get.Plz tell
0
0
Arjun sir...but what is the meaning of 2^16 or 2^12 (here also we are taking addresses but different addresses will not change the same instruction)...........Why we multiplying by 2^12 ?
0
0
That is due to binary encoding. We are basically considering all possible encodings of a binary string of 16 bits. But for one-address instructions, some bits are taken by address- and these are not counted as separate instructions.
0
0
So basically we are considering all the addresses also because...later some of the addresses could be a part of opcode.
0
0
^Yes, Here opcode length is not fixed. That is why it is called "expanding opcode".
1
1
unable to understand through the shared link as well :(
0
0
nice explanation sir.. Thank you :)
1
1
14 votes
14 votes
16 bit instruction

6 bit address

so no of bits for opcode =4

so 16 instructions  are possible

out of them n are two address

so no of one address instruction possible=(16-n)*2^6=(16-n)* 64

4 Comments

Thanks yes

0
0
@Pooja Method is not fully correct.
1
1
for one address instruction we can not use 10 bit becoz there are (16-n) 4 bit and all pairs of 6bit therefore maximum(16 - n) 2^6 instructions
0
0
0 votes
0 votes

This is the ans

2 Comments

Your answer is right, but my confusion is:

The number of opcodes for one address will be 10 right, since the computer uses expanding opcode?? So wont we get 2^10 instructions for opcode for one address?

1
1
i think pooja just resolved your query .
0
0

Related questions