Question

In: Computer Science

Encode the following instruction opcode: 100011 (1) identify the instruction format that will be used (2)...

Encode the following instruction

opcode: 100011

(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 values to binary

(4) represent the entire instruction as one hexadecimal value.

subu $t3,$v1,$s2

Solutions

Expert Solution

There are three instruction categories: R-format, I-format, and J-format.

Given,

# opcode: 100011

# Instruction: subu $t3,$v1,$s2

** First we talk about the opcode: 100011

(1)=>  Here is the given opcode= 100011, according to this opcode the instruction format come in " I-format instruction" where the instruction format contains:

  • rs: register containing base address (5 bits)
  • rt: register destination/source (5 bits)
  • immediate: value or offset (16 bits)

According to the given opcode the following instruction is:

Example:

lw $t0, 32($s3)

where, $t0, $s3 are registers and 32 is immediate.

(2)=> Here is the instruction format with decimal values:  

Opcode rs rt immediate
35 19 8 32 (offset)

(3)=> Here is the instruction format with binary values:

Opcode rs rt immediate
100011 10011 01000 0000000000100000

(4)=> Here is the entire instruction as one hexadecimal value:

Binary: 1000 1110 0110 1000 0000 0000 0010 0000

Hexa: 8 E 6 8 0 0 2 0

So, the Hexa value:

0x8E680020

** Lets we talk about the instruction format:  subu $t3,$v1,$s2

(1)=>  Here is the given Instruction: subu $t3,$v1,$s2, according to this instruction, the instruction format come in " R-format instruction" where the instruction format contains:

  • Opcode= 0 (Always)
  • rs: 1st register operand (source register) (5 bits)
  • rt: 2nd register operand (5 bits)
  • rd: register destination (5 bits)
  • shamt: shift amount (0 when N/A) (5 bits)
  • funct: function code (6 bits)

(2)=> Here is the instruction format with decimal values:  

Opcode rs rt rd shamt funct
0 2 1 3 0 35

(3)=> Here is the instruction format with binary values:

Opcode rs rt rd shamt funct
000000 00010 00001 00011 00000 100011

(4)=> Here is the entire instruction as one hexadecimal value:

Binary: 0000 0000 0100 0001 0001 1000 0010 0011

Hexa: 0 0 4 1 1 8 2 3

So, the Hexa value:

0x00411823


Related Solutions

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 j L2. # where L2 is at the decimal byte address 1,048,608
Suppose the opcode of an MIPS instruction is 12 in decimal, and the rest of the...
Suppose the opcode of an MIPS instruction is 12 in decimal, and the rest of the machine code is 23483DB 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). For branch instructions, show offset in place of label, e.g. beq $t1, $t2, 92.
Please answer all question for the feedback. 1. What is an Instruction Specifier (or opcode)? What...
Please answer all question for the feedback. 1. What is an Instruction Specifier (or opcode)? What is an Operand Specifier? 2. What is the difference between aaa and a? 3. How do you grow the stack? How do you shrink the stack? 4. Given: int xyz(int a) {      int b;      ... some code     return b; } What would the stack look like after the function allocates its local variable of b? 5. The debugger has trace commands...
i)In a computer, an instruction is composed of two fields: the opcode and an operand address....
i)In a computer, an instruction is composed of two fields: the opcode and an operand address. what is the minimum size of your instruction in bits if an instruction set of 327 opcodes and an address space of 128 Mbytes is required? NB. Use 1 Mbyte = 2^20 bytes ii) Instead of hard-writing the units, the software is used to interpret and execute instructions in a general-purpose system. Is the statement true or false
What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
In a computer instruction format, the instruction length is 11 bits and the size of an...
In a computer instruction format, the instruction length is 11 bits and the size of an address field is 4 bits. Is it possible to have 5 two-address instructions 45 one-address instructions 32 zero-address instructions using the specified format? Justify your answer.
In a computer instruction format, the instruction length is 12 bits and the size of an...
In a computer instruction format, the instruction length is 12 bits and the size of an address field is 5 bits. The system architect has already designed three 2-address instructions and thirty one 1-address instructions. How many 0-address instructions can still be possibly accommodated?
Encode 32-bit INTEGER 12 in TLV format?
Encode 32-bit INTEGER 12 in TLV format?
Instruction : Follow format MLA style to format the paper and cite sources. - Have three...
Instruction : Follow format MLA style to format the paper and cite sources. - Have three or more sources cited on the works cited page. Question : Write an essay on the following topic: Contribution of technology in education. The essay must have a word of 500 - 700 Excluding title, header and works cited page
1 The information in this mini case is fictitious and the case is used for instruction...
1 The information in this mini case is fictitious and the case is used for instruction purpose only. Case questions are provided at the bottom. Kensington Plastics In December 2017, Michael Roberts, managing direct or of Kensington Plastics, was considering the purchase of a PlaTech 2 automated injecti on molding machine. The PlaTech 2 would replace older semiautomated machines and would offer improvement in quality and some additional capacity for expansion. Given the size of the pr oposed expenditure of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT