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

Correct Answer:

14

Solution:

Given:
Instruction length = 16 bits
Number of Register = 64 = 26
Register field contain = 6 bits

Given, 8 distinct I-type opcodes and let y R-type opcodes.

Then (8 * 26 * 24 ) + (y * 26 * 26) = 216 = maximum possible encoding

⇒ y * 212 = 65536 - 8192
⇒ y = 57344 / 212
⇒ y = 14