Question

What is the opcode and the rs fields encoded in the following instruction: 30620001

What is the opcode and the rs fields encoded in the following instruction:

30620001

Homework Answers

Answer #1

Answer :

All instructions in the MIPS R2000 Architecture are 32 bits in length. There are three different instruction formats: R-Type instructions, I-Type instructions, and J-Type instructions.

R-Type instructions, or Register instructions are used for register based ALU operations. The two operands and the destination of the result are specified by locations in the register file.

I-Type instructions, or Immediate instructions, can be either Load/Store operations, Branch operations, or Immediate ALU operations. In these instructions, one two register file locations are specified as well as a 16-bit immediate value which may be used as an operand or an address.

The rs and rt register addresses, which are present in both R- and I-type instructions, specify the two addresses which the register file is to read. In R-Type instructions the destination (write) register for the register file is specifies by rd and in I-Type instructions the destination register is specified by rt (the second read from the register file is ignored).

An R-Type instruction contains 6 fields: a 6 bit function code (funct), a 5 bit shift amount (shamt), three 5 bit register addresses (rd, rt, rs), and a 6 bit operation code (opcode) which is always zero.

An I-Type instruction contains 4 fields: a 16 bit immediate field (immed. or address), two 5 bit register addresses (rt, rs) and a 6 bit operation code (opcode).

R-Type Instruction Format:

31-26 25-21 20-16 15-11 10-6 5-0
opcode (000000) rs rt rd shamt funct

rs = operand A location in register file; rt = operand B location in register file; rd = result destination location in register file; shamt = shift amount; funct = function code

I-Type Instruction Format (ALU immediate):

31-26 25-21 20-16 15-0
opcode rs rt immed.

rs = operand A location in register file; rt = result destination location in register file; immed. = operand B location in register file

Now the binary notation of the given instruction 30620001 is :

0011 0000 0110 0010 0000 0000 0000 0001
MSB LSB

In both the type of instruction bits 31 to 26 are opcode and bits 25 to 21 is for rs , so the opcode and rs for this instruction will be :

Opcode : 001100

rs : 00011

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
For the MIPS instruction sw $s3,18820($t5), show the immediate number, opcode, rs, and rt in binary...
For the MIPS instruction sw $s3,18820($t5), show the immediate number, opcode, rs, and rt in binary in the given order, separated by comma.
Suppose the opcode of an MIPS instruction is 0 in decimal, the funct is 011000 in...
Suppose the opcode of an MIPS instruction is 0 in decimal, the funct is 011000 in binary, and the rest of the machine code is c4000 in hexadecimal (from high-order bit to low-order bit). What is the instruction? When showing the registers, use names (e.g. $t0, $s2) instead of indices (e.g $8, $17).
Design an expanding opcode instruction set for a computer having 18-bit instructions and the following types...
Design an expanding opcode instruction set for a computer having 18-bit instructions and the following types of instructions. There are 16 CPU registers and 16 bit addresses a. T1: 63 instructions with three registers referenced b. T2: 15 instructions with an 8 bit constant value c. T3: 16 instructions with one register reference
Consider the following instruction: OR Rd, Rs, Rt Which has the following meaning in Verilog: Reg[Rd]...
Consider the following instruction: OR Rd, Rs, Rt Which has the following meaning in Verilog: Reg[Rd] = Reg[Rs] OR Reg[Rt] Fill out the table below to show what values the control block provides to each output it is connected to: RegWrite MemRead ALUMux MemWrite ALUop RegMux Branch OR
Consider the following instruction: OR Rd, Rs, Rt Fill out the table below to show what...
Consider the following instruction: OR Rd, Rs, Rt Fill out the table below to show what values the control block provides to each output it is connected to: Reg Write Mem Read ALUMux Mem Write ALUop RegMux Branch OR ALUMux is the control signal that controls the Mux at the ALU input, 0 selects the output of the register file, and 1 selects the immediate from the instruction word as the second input to the ALU. RegMux is the control...
Encode the following instruction (1) identify the instruction format that will be used (2) indicate the...
Encode the following instruction (1) identify the instruction format that will be used (2) indicate the values of each of the fields for that format in decimal (3) convert each of these decimal val- ues to binary (4) represent the entire instruction as one hexadecimal value ori $t1,$a2,7
Encode the following instruction (1) identify the instruction format that will be used, (2) indicate the...
Encode the following instruction (1) identify the instruction format that will be used, (2) indicate the values of each of the fields for that format in decimal, (3) convert each of these decimal val- ues to binary 4) represent the entire instruction as one hexadecimal value. subu $t3,$v1,$s2
Assignment-I Write the output for the following instructions MOV B , A             Before instruction execution, the...
Assignment-I Write the output for the following instructions MOV B , A             Before instruction execution, the contents of registers B and A are                                  Rd= B= XBH                         Rs= A = 1FH              After the execution of instruction.                                 Rd= B = ?                         Rs= A = ? ADD B If A= E 3H   B=  0 4H then after the  execution of the above instruction the content of A = ? SUI 03H If the value of A = 15Hthen after the execution of the above instruction...
A microprocessor has an increment memory direct instruction, which adds 1 to the value in memory...
A microprocessor has an increment memory direct instruction, which adds 1 to the value in memory location. The instruction has five stages: fetch opcode (four bus clock cycles); fetch operand address (four bus clock cycles); fetch operand (five bus clock cycles); add 1 to operand (three bus clock cycles) and, store operand (two bus clock cycles). By what amount (in percent) will the duration of the instruction increase if we have to insert four bus wait states in each memory...
Consider a hypothetical microprocessor having 64-bit instructions composed of two fields: the first two bytes contain...
Consider a hypothetical microprocessor having 64-bit instructions composed of two fields: the first two bytes contain the opcode and the remainder the immediate operand or operand address. What is the maximum directly accessible memory capacity (in Bytes)? Provider answer in Giga Bytes.