Skip to content
Official PYQ · 2016

GATE CS 2016 Set 2 Q10 — Machine Instructions and Addressing Modes

Explain with AI
A processor has 4040 distinct instruction and 2424 general purpose registers. A 3232-bit instruction word has an opcode, two registers operands and an immediate operand. The number of bits available for the immediate operand field is_______.
View worked solution

Answer: 16

To find the number of bits available for the immediate operand field, we calculate the bits required for each of the other fields in the 32-bit instruction word:

  1. Opcode Field:
    The processor has 4040 distinct instructions. The number of bits required to uniquely represent 4040 opcodes is: Opcode bits=⌈log⁡2(40)⌉=6 bits\text{Opcode bits} = \lceil \log_2(40) \rceil = 6\text{ bits}
  2. Register Operand Fields:
    The processor has 2424 general-purpose registers. The number of bits required to address one register is: Register bits=⌈log⁡2(24)⌉=5 bits\text{Register bits} = \lceil \log_2(24) \rceil = 5\text{ bits} Since the instruction contains two register operands, the total bits required for registers is: 2×5=10 bits2 \times 5 = 10\text{ bits}

The total instruction word length is 3232 bits. Therefore, the bits remaining for the immediate operand field are:

Immediate bits=32−(Opcode bits+Register bits)\text{Immediate bits} = 32 - (\text{Opcode bits} + \text{Register bits}) Immediate bits=32−(6+10)=16 bits\text{Immediate bits} = 32 - (6 + 10) = 16\text{ bits}

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions