Computer Sciences > Gate 2024 Set-2 > Tree
A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below.
R-type Instruction Format:
In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size.
Let 𝑋 be the number of bits used to encode the UNUSED field, π‘Œ be the number of bits used to encode the OPCODE field, and 𝑍 be the number of bits used to encode the immediate value/address field. The value of 𝑋 + 2π‘Œ + 𝑍 is ________

Correct : 34

Explanation:
Let us break down the sizing of each individual field in the 32-bit instruction format based on the given constraints.

1. Calculate the Sizing of the OPCODE Field (Y):
β€’ The processor supports 150 distinct instructions, which are equally divided into two types: 75 R-type and 75 I-type instructions.
β€’ To uniquely encode 75 distinct operations within either type, we need:
    26 < 75 ≤ 27 → 7 bits are required to indicate the operation.
β€’ The problem states that in the OPCODE field, 1 extra bit is explicitly used to distinguish between I-type and R-type configurations.
    Total OPCODE bits (Y) = 1 bit (type identifier) + 7 bits (operation identifier) = 8 bits.

2. Calculate the Sizing of the Register Fields:
β€’ The processor contains 50 architectural registers.
β€’ To address any one of these 50 unique registers, the number of bits required per field is:
    25 < 50 ≤ 266 bits per register field.

3. Calculate the Sizing of the UNUSED Field (X) in R-type format:
β€’ An R-type instruction consists of: [ OPCODE ] [ UNUSED ] [ DST Register ] [ SRC Register 1 ] [ SRC Register 2 ].
β€’ The total instruction size is 32 bits.
    32 = Y + X + (3 × Register Field Bits)
    32 = 8 + X + (3 × 6)
    32 = 8 + X + 18
    32 = X + 26 → X = 32 - 26 = 6 bits.

4. Calculate the Sizing of the Immediate Field (Z) in I-type format:
β€’ An I-type instruction consists of: [ OPCODE ] [ DST Register ] [ SRC Register ] [ Immediate Value/Address ].
    32 = Y + (2 × Register Field Bits) + Z
    32 = 8 + (2 × 6) + Z
    32 = 8 + 12 + Z
    32 = 20 + Z → Z = 32 - 20 = 12 bits.

5. Compute the Final Expression (X + 2Y + Z):
β€’ X = 6
β€’ Y = 8
β€’ Z = 12

    X + 2Y + Z = 6 + 2(8) + 12
    X + 2Y + Z = 6 + 16 + 12 = 34.

Similar Questions

The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height 5 are
#67 MCQ
Let T be a tree with 10 vertices. The sum of the degrees of all the vertices in T is _____.
#601 Fill in the Blanks
In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?
#836 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......