R-type Instruction Format:

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 ≤ 26 → 6 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
Total Unique Visitors