2,333 views

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?

1. $32$
2. $64$
3. $128$
4. $16$

### 1 comment

option b) is correct 6-bit for each register indentifier. So 2^6 = 64 registers.

## 2 Answers

$\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.

by

### 4 Comments

Sir How many registers the processor has?

why we will not add r1 + r2 i.e is 64+ 64 = 128

we can do this when asked How many total registers are there?

edited by
Good question but see, the $12$ bits are already equally divided between two registers. Therefore, we get $6$ bits per register. So, the maximum possible value of registers are $\mathbf{2^{6}}$.

Since you have already divided $12$ bits equally in the beginning, you don’t have to make it $64 +64$.
the maximum possible value of registers are 2^64 ?

2^6 (typo)
Right.

Thanks for the correction.

$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

### 1 comment

32-7-13 = 12 and each register will take 6 bit.

number of register will be 64
Answer:

3 votes
5 answers
1
2,830 views
1 vote
1 answer
2
2,051 views
4 votes
3 answers
3
1,715 views
5 votes
3 answers
4
2,197 views