in CO and Architecture edited by
2,333 views
7 votes
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?

  1. $32$
  2. $64$
  3. $128$
  4. $16$
in CO and Architecture edited by
by
2.3k views

1 comment

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

2 Answers

9 votes
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.

 

edited by
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?

2
2
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$.
1
1
the maximum possible value of registers are 2^64 ?

2^6 (typo)
0
0
Right.

Thanks for the correction.
0
0
1 vote
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

1 comment

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

number of register will be 64
0
0
Answer:

Related questions