Skip to content
Official PYQ · 2024

GATE CS 2024 Set 2 Q47 — Machine Instructions and Addressing Modes

Explain with AI
A processor with 1616 general purpose registers uses a 3232-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 1616-bit scalar field. If 88 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is ___________.
View worked solution

Answer: 32

To find the maximum number of unique opcodes, we need to determine the size of the opcode field in the 3232-bit instruction format.

Let's calculate the bits required for each field in the instruction:

  • Register Operand Fields: The processor has 1616 general-purpose registers. The number of bits required to address one register is: log⁡2(16)=4 bits\log_2(16) = 4\text{ bits} Since there are two register operand fields, they require: 2×4=8 bits2 \times 4 = 8\text{ bits}
  • Addressing Mode Field: The processor supports 88 addressing modes. The number of bits required is: log⁡2(8)=3 bits\log_2(8) = 3\text{ bits}
  • Scalar Field: Given as 16 bits16\text{ bits}.

The total number of bits occupied by these fields is:

Bits occupied=8 (registers)+3 (addressing mode)+16 (scalar)=27 bits\text{Bits occupied} = 8\text{ (registers)} + 3\text{ (addressing mode)} + 16\text{ (scalar)} = 27\text{ bits}

Since the total instruction format is 3232 bits, the remaining bits are allocated to the opcode field:

Opcode bits=32−27=5 bits\text{Opcode bits} = 32 - 27 = 5\text{ bits}

The maximum number of unique opcodes possible with 55 bits is:

25=322^5 = 32

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

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