retagged by
28,775 views
24 votes
24 votes
A processor has $64$ registers and uses $16$-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a $4$-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are $8$ distinct I-type opcodes, then the maximum number of distinct R-type opcodes is _______.
retagged by

6 Answers

1 votes
1 votes

 

Let there are x instructions of type-R 

R-type instruction format

Opcode(4 bits)

Register (6bits)

Register(6bits)

 

Thus, from 2^4 (=16) instructions "x" instructions are of type-R and left over 4 bit instructions are

(2^4)-x 

 

Now, for type-I instruction format

I-type instruction format

Opcode(6 bits)

Register(6 bits)

Immediate value (4bits)

 

 

In Opcode field we assume as 4bits+2bits i.e., 4bit instructions for I-type are taken form left over 4 bit instructions

i.e. (2^4)-x 

I-type instruction format

                   Opcode                                                      Register                                           Immediate value

     4bits

      2bits

                           6bits

           4bits

 

As per question there are 8 instructions of I-type

=> ((2^4)-x) * (2^2) = 8

(2^4)-x = 8/4

16 - x = 2

x = 14

Therefore there are 14 instructions of R-type  

0 votes
0 votes
Ans is 14

We add total no of used addresses ( I type and R type)

 

(8×2^6×2^4)+(x×2^6×2^6)=2^16 { as 2^16 is the total encoding }

by solving we get x = 14
Answer:

Related questions