GATE 2024 EC – Question 27
A machine has a 32-bit architecture with 1-word long instructions. It has 24 registers and supports an instruction set of size 40. Each instruction has five distinct fields, namely opcode, two source register identifiers, one destination register identifier, and an immediate value. Assuming that the immediate operand is an unsigned integer, its maximum value is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 2047
Explanation
The opcode needs $\lceil\log_240\rceil=6$ bits. Each of the three register identifiers needs $\lceil\log_224\rceil=5$ bits, i.e. 15 bits. That leaves $32-6-15=11$ bits for the immediate, whose maximum unsigned value is $2^{11}-1=2047$.