Skip to content
Official PYQ · 2018

GATE CS 2018 Q51 — Machine Instructions and Addressing Modes

Explain with AI
A processor has 1616 integer registers (R0, R1,…, R15)\text{(R0, R1}, \ldots ,\text{ R15)} and 6464 floating point registers (F0, F1,…,F63).\text{(F0, F1}, \ldots , \text{F63)}. It uses a 2- byte2\text{- byte} instruction format. There are four categories of instructions: Type-1, Type-2, Type-3,\text{Type-1, Type-2, Type-3}, and Type-4. Type-1\text{Type-4. Type-1} category consists of four instructions, each with 33 integer register operands (3Rs). Type-2\text{(3Rs). Type-2} category consists of eight instructions, each with 22 floating point register operands (2Fs). Type-3\text{(2Fs). Type-3} category consists of fourteen instructions, each with one integer register operand and one floating point register operand (1R+1F). Type-4\text{(1R+1F). Type-4} category consists of N\text{N} instructions, each with a floating point register operand (1F).\text{(1F)}.

The maximum value of N\text{N} is _________.
View worked solution

Answer: 32

To find the maximum value of NN, we use the concept of expanding opcodes. The instruction size is 2 bytes=16 bits2\text{ bytes} = 16\text{ bits}.

  • Register addressing:
    • Integer registers (1616 registers): log⁡2(16)=4 bits\log_2(16) = 4\text{ bits}
    • Floating-point registers (6464 registers): log⁡2(64)=6 bits\log_2(64) = 6\text{ bits}
  • Type-1 (3Rs): Uses 3×4=12 bits3 \times 4 = 12\text{ bits} for operands, leaving 4 bits4\text{ bits} for the opcode.
    • Total possible opcodes = 24=162^4 = 16
    • Used = 44
    • Remaining 4-bit opcodes = 16−4=1216 - 4 = 12
  • Type-2 (2Fs): Uses 2×6=12 bits2 \times 6 = 12\text{ bits} for operands, leaving 4 bits4\text{ bits} for the opcode.
    • Available 4-bit opcodes = 1212
    • Used = 88
    • Remaining 4-bit opcodes = 12−8=412 - 8 = 4
  • Type-3 (1R + 1F): Uses 4+6=10 bits4 + 6 = 10\text{ bits} for operands, leaving 6 bits6\text{ bits} for the opcode.
    • Available 6-bit opcodes = 4×26−4=164 \times 2^{6-4} = 16
    • Used = 1414
    • Remaining 6-bit opcodes = 16−14=216 - 14 = 2
  • Type-4 (1F): Uses 6 bits6\text{ bits} for the operand, leaving 10 bits10\text{ bits} for the opcode.
    • Available 10-bit opcodes = 2×210−6=2×16=322 \times 2^{10-6} = 2 \times 16 = 32

Thus, the maximum value of NN is 32.

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

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