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
Explanation
64 registers need 6 bits each; two register operands use 12 bits. Supporting 45 distinct instructions needs an opcode field of ⌈log₂45⌉=6 bits. Fixed fields total 6+12=18 bits, leaving 32−18=14 bits for the immediate operand. Max unsigned value with 14 bits = 2^14−1 = 16383.
Source: GATE CS 2014 (Session 1) (2014)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.