0
$\begingroup$

A machine has a 64-bit architecture, with 2-word long instructions. It has 128 registers, each of which is 32 bits long. It needs to support 49 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is a signed integer, the maximum value of the immediate operand is that can be stored is?

edit: would 1 word long instruction for this case be of 64 bit and 2 word long instruction be of 128 bits? Also do we have to add an extra bit while calculating the total bits required for 49 instructions?

$\endgroup$
1
  • $\begingroup$ What do you mean about that "extra bit"? If the opcode field is supposed to be 7 bits, that is something that does not follow from the information you gave. $\endgroup$
    – harold
    Mar 19 '20 at 8:05
1
$\begingroup$

A "64 bit architecture" with 32 bit registers is a bit unusual.

Taking the numbers at face value, a 2-word instruction is 128 bit long, you need 6 bit to encode the instruction, 2x7 bits to specify two registers, leaving 108 bits for an "immediate" operand. The maximum value in the "immediate" operand is $2^{107}-1$.

That's answering the question that you asked. What your instructor actually asked, and what he intended to ask, and what he thinks he asked, and what answer he wants to hear, nobody can know that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.