retagged by
13,531 views
29 votes
29 votes
A processor has $40$ distinct instruction and $24$ general purpose registers. A $32$-bit instruction word has an opcode, two registers operands and an immediate operand. The number of bits available for the immediate operand field is_______.
retagged by

5 Answers

Best answer
57 votes
57 votes
Instruction Opcode Size $= \log_2 40 = 6$

Register operand size $= \log_224 =5$

Total bits available $= 32$

Bits required for opcode $+$ two register operands $= 6 + 2 \times 5 = 16$

Bits available for immediate operand $= 32 - 16 = 16.$
edited by
1 votes
1 votes

Ans: 16

For 40 distinct instructions, you need atleast 6 bits for Opcode

For 24 distinct registers you need at least 5 bits to represent a single General purpose register.

So you can see in the image, I have explained the value of x. 

 

 

 

0 votes
0 votes

Answer : 16


For 40 distinct instructions : 

no. of bits need = Ceil (log(40)) =6

no. of bits need for 1 register =Ceil (log(24)) = 5

for another register = 5

for immediate operand :

no. of bits = 32-(6+5+5) = 16

6 5 5 16

op code       R1               R2          immediate

Answer:

Related questions

50 votes
50 votes
4 answers
3
Akash Kanase asked Feb 12, 2016
17,628 views
The width of the physical address on a machine is $40$ bits. The width of the tag field in a $512$ KB $8$-way set associative cache is ________ bits.