###### Reading-Comprehension

October 28, 2024# Computer-Organization

Question 20 |

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

14 |

All possible binary combinations = 2

^{16}

There are 64 registers, so no. of bits needed to identify a register = 6

I-type instruction has (Opcode+Register+4-bit immediate value). There are 8 distinct I-type instructions.

All the binary combinations possible with the I-type instructions are = 8*2^{6}*2^{4} = 2^{13}

R-type instructions have 2 register operands.

Let x be the number of R-type instructions.

All the possible binary combinations of R-type instructions = x*2^{6}*2^{6} = x*2^{12}

The sum of I-type and R-type binary combinations should be equal to 2^{16}.

x*2^{12} + 2^{13} = 2^{16}

2^{12} (x+2) = 2^{16}

x+2 = 2^{4}

x = 16 – 2 = 14

All possible binary combinations = 2

^{16}

There are 64 registers, so no. of bits needed to identify a register = 6

I-type instruction has (Opcode+Register+4-bit immediate value). There are 8 distinct I-type instructions.

All the binary combinations possible with the I-type instructions are = 8*2^{6}*2^{4} = 2^{13}

R-type instructions have 2 register operands.

Let x be the number of R-type instructions.

All the possible binary combinations of R-type instructions = x*2^{6}*2^{6} = x*2^{12}

The sum of I-type and R-type binary combinations should be equal to 2^{16}.

x*2^{12} + 2^{13} = 2^{16}

2^{12} (x+2) = 2^{16}

x+2 = 2^{4}

x = 16 – 2 = 14