We have total 64 registers: bits required for representation of 64 registers=6 bits
Given: 16-bit instruction format.
I-type instruction format:
Oppose |
Register |
Immediate Value
|
6 bits |
6 bits |
4 bits |
So total possible opcodes for I-type instruction are 2^6= 64 opcodes.
Out of 64 opcodes, we utilise 8 opcodes for I-type instruction, so we have 56 remaining opcodes.
R-type instruction format:
Opcodes |
Register |
Register |
4 bits |
6 bits |
6 bits |
Consider:
Now, if my R-type instruction had 4 bit opcode and I type instruction had 6 bit opcode, then we would be utilizing two extra bits for opcodes. So total possible opcodes for I-type would have been 2^4( All possible combination of 4 bit opcode) * 2^2( All possible combinations of 2 extra bits used)
Now here, we had 6 bit opcode for I-type instruction and R-type instruction has 4 bit opcode, that is we utilised two bit from opcode in instruction format. Our remaining number of instructions are 56 and all possible combinations of 2 bits are 4. So we do opposite of the above mentioned scenario i.e. divide by 4
So possible opcodes for R-type instruction= 56/4
So answer would be 14.