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
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