Dark Mode

2,333 views

7 votes

Consider a $32$- bit processor which supports $70$ instructions. Each instruction is $32$ bit long and has $4$ fields namely opcode, two register identifiers and an immediate operand of unsigned integer type. Maximum value of the immediate operand that can be supported by the processor is $8191$. How many registers the processor has?

- $32$
- $64$
- $128$
- $16$

9 votes

$\underline{\textbf{Answer:}\Rightarrow}$

$\underline{\textbf{Explanation:}\Rightarrow}$

Opcode | Reg1 | Reg2 | Immediate Operand |

Number of instructions which are supported $=70$

$13-\text{bits}$ support the maximum value of immediate operand $=8191$

Now,

Number of bits needed for opcode $=7\;\text{bits}$

Number of bits left to represent register bits $=12$

which means $6-\text{bits}$ per register.

Hence, at max. $\mathbf{64}$ registers.

$\therefore \;\mathbf{(b)}$ is the correct option.

1 vote

$32$ bit instruction contains opcode, two registers say $R1, R2$ and one unsigned immediate operand.

Since 70 instructions are supported, each instructions will take $log70$= 7 bit for each opcode.

Maximum value of opcode is $8191$ that means it takes 13 bit ranging $0-8191$

Opcode(7 bit) | R1 | R2 | Immediate Op.(13bit) |

Bits needed for two registers = $32-7-13=12$

Each register takes 6 bits, i.e maximum 64 registers are possible.

**Hence Option B) is correct**