in CO and Architecture retagged by
11,743 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.7k 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

4 Comments

^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