in CO and Architecture edited by
1,557 views
1 vote
1 vote
A processor uses a $32$-bit instruction format and supports byte-addressable memory access. The $\text{ISA}$ of the processor has $150$ distinct instructions. The instructions are equally divided into two types, namely $\text{R}$-type and $\text{I}$-type, whose formats are shown below.

R - type Instruction Format:
\begin{array}{|l|l|l|l|l|}
\hline OPCODE & UNUSED & DST Register & SRC Register1 & SRC Register 2 \\
\hline
\end{array}

I - type Instruction Format:
\begin{array}{|l|l|l|l|}
\hline OPCODE & DST Register & SRC Register & \# Immediate value/address \\
\hline
\end{array}

In the $\text{OPCODE}$, $1$ bit is used to distinguish between $\text{I}$-type and $\text{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 $\text{X}$ be the number of bits used to encode the $\text{UNUSED}$ field, $\text{Y}$ be the number of bits used to encode the $\text{OPCODE}$ field, and $\text{Z}$ be the number of bits used to encode the immediate value/address field. The value of $\text{X+2Y+Z}$ is __________.
in CO and Architecture edited by
by
1.6k views

1 Answer

0 votes
0 votes
  • Opcode field(Y): There are 150 instructions, and they are equally divided into two types. Therefore, there are 75 I-type instructions and 75 R-type instructions. Since one bit is used to distinguish between instruction types, the number of bits used to encode opcode field is Y = (1+7) = 8
  • Register field: There are 50 architectural registers and all register fields in the instructions are of equal size. Therefore, the number of bits used to encode register field is 6

  • Unused field(X): The number of bits used to encode unused field in R-type instructions is X = 32 - (8 + 6 + 6 + 6) = 6
  • Immediate value/address field(Z): The number of bits used to encode immediate value/address field in I-type instructions is Z = 32 - (8 + 6 + 6) = 12

Therefore, the values of X, Y, and Z are:

  • X = 6 bits (UNUSED field)
  • Y = 8 bits (OPCODE field)
  • Z = 12 bits (immediate value/address field)

So the answer is 6 + 2 * 8 + 12 = 34

edited by
Answer:

Related questions