retagged by
365 views
1 votes
1 votes
A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is...

That I got : 32 bit architecture and 1 word long instructions ...1 instructions size = 32 bits

                   64 registers each of which is 32 bits long

can any one explain this line--> It needs to support 45 instructions, which have an immediate operand in addition to two register operands??

 

Note: I know this is previous year gate questions . Don't close it.
retagged by

1 Answer

2 votes
2 votes

Your Question is 1) It need to support 45 instruction 2)  which have an immediate operand in addition to two register operands??

Part 1 : when we write instruction Add 2,3 here 2 and 3 are operand and add is opcode 

Machine only knows 0 and 1 so there must be an code correspond to add operation 

It need to support 45 instruction means we have 45 different operations like add, sub, mul, div, shift, logical and etc. so we need unique combination of code to differentiate between two different operation 

so we required 6 bit for it which will give 64 unique combination out of which 45 is needed and we are not bothered about remaining .

part 2: 

Instruction format is 

Opcode  R1 R2 Immediate

Now immediate operand means value is directly given, l

Eg: Add R1,R2,27 

it could be like this R1=R2+27 

to represent 27 in binary we require some bits 

so hence it means that after giving bits to address 45 instruction, registers remaining left is available for immediate operand