Question
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 ____________.
Official answer and solution
- Official answer
- 16383
- From
- Official GATE 2014 answer key
Solution
Determine the bit width of each instruction field and subtract from the 32-bit total instruction length to find the bits available for the immediate operand.
- Instruction length = 1 word = 32 bits.
- Number of distinct instructions = 45.
The number of bits required for the opcode is: - Number of registers = 64.
The number of bits required to specify one register is:There are 2 register operands, so the register fields take: - Remaining bits for the immediate operand:
- For an unsigned 14-bit integer, the maximum value is:
16383
Using 5 bits for opcode (, which cannot support 45 instructions) or giving instead of .
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 1
- Question
- 19 of 65, printed as CS Q.9
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.