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 , bit is used to distinguish between -type and -type instructions and the remaining bits indicate the operation. The processor has architectural registers, and all register fields in the instructions are of equal size.
Let be the number of bits used to encode the field, be the number of bits used to encode the field, and be the number of bits used to encode the immediate value/address field. The value of is __________.
View worked solution
Answer: 34
To find the value of , we determine the size of each field step-by-step:
1. Size of the OPCODE Field ()
- The total number of distinct instructions is , equally divided into two types: R-type and I-type instructions.
- The OPCODE uses bit to distinguish between R-type and I-type.
- The remaining bits must uniquely represent operations for each type. The number of bits required is:
- Thus, the total size of the OPCODE field is:
2. Size of Register Fields
- The processor has architectural registers.
- The number of bits required to address registers is:
- Since all register fields are of equal size, each register field (DST, SRC, SRC1, SRC2) takes bits.
3. Size of the UNUSED Field () in R-type Instruction
The total instruction size is bits. For the R-type format:
4. Size of the Immediate Field () in I-type Instruction
For the I-type format:
5. Calculation of
Substituting the values of , , and :
Free practice · Your answers on this page are not saved.
