Skip to content
Official PYQ · 1992

GATE CS 1992 Q01-vi — Machine Instructions and Addressing Modes

Explain with AI
In an 1111-bit computer instruction format, the size of address field is 44-bits. The computer uses expanding OP code technique and has 55 two-address instructions and 3232 one-address instructions. The number of zero-address instructions it can support is ________
View worked solution

Answer: 256

We can solve this problem using two methods: the State-Space Method (most efficient) and the Expanding Opcode Method.

Method 1: State-Space Method

An 1111-bit instruction format provides a total of 211=20482^{11} = 2048 distinct states (combinations).

  • Two-address instructions: Each instruction has two 44-bit address fields.
    States consumed per instruction = 24×24=2562^4 \times 2^4 = 256.
    States consumed by 55 two-address instructions = 5×256=12805 \times 256 = 1280 states.
  • One-address instructions: Each instruction has one 44-bit address field.
    States consumed per instruction = 24=162^4 = 16.
    States consumed by 3232 one-address instructions = 32×16=51232 \times 16 = 512 states.
  • Zero-address instructions: Each instruction has zero address fields.
    States consumed per instruction = 20=12^0 = 1.
    Let NN be the number of zero-address instructions. States consumed = N×1=NN \times 1 = N states.

Equating the total states consumed to the total available states:

1280+512+N=20481280 + 512 + N = 2048 1792+N=20481792 + N = 2048 N=2048−1792=256N = 2048 - 1792 = 256

Method 2: Expanding Opcode Method

  1. Two-address instructions:
    • Opcode size = 11−(4+4)=311 - (4 + 4) = 3 bits.
    • Total possible opcodes = 23=82^3 = 8.
    • Opcodes used = 55.
    • Unused opcodes left for expansion = 8−5=38 - 5 = 3.
  2. One-address instructions:
    • Opcode size = 11−4=711 - 4 = 7 bits.
    • By expanding the 33 unused opcodes with the 44-bit address field, we get: 3×24=483 \times 2^4 = 48 possible opcodes.
    • Opcodes used = 3232.
    • Unused opcodes left for expansion = 48−32=1648 - 32 = 16.
  3. Zero-address instructions:
    • Opcode size = 1111 bits.
    • By expanding the 1616 unused opcodes with the remaining 44-bit address field, we get: 16×24=25616 \times 2^4 = 256 possible opcodes.

Thus, the computer can support a maximum of 256 zero-address instructions.

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

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