Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Provide the type, assembly language instruction, and binary representation of instruction described by the following MIPS fields:

op= 0×23, rs=1, rt=2, const=0×4

Short Answer

Expert verified

The type of instruction is I-type. The assembly language instruction is lw. The binary representation of instruction is 1000 1100 0010 0010 0000 0000 0000 0100.

Step by step solution

01

Identify the types of MIPS instructions

Each MIPS instruction is 32 bit long. MIPS instructions have an opcode field that specifies the operation of the instruction. MIPS instructions are divided into three categories: I-type, J-type, R-type.

02

Identify I-type instruction

The I-type instruction has opcode, the first register source operand, the second register source operand and address. In this instruction, the operand is a constant within the instruction itself. The type of instruction described by the MIPS field is an immediate instruction. The instruction has four fields, opcode, rs, rt, and constof 16-bit representing the address. Therefore, the instruction type is I-type.

03

Assembly language instruction

The MIPS instruction given provides the opcode, rs and rt fields. Along with these fields, the address field is provided. Load word (lw) command copies the value stored at a memory address to a destination register. The offset is the instruction is 16-bit value. The instruction loads the data from the specified 16-bit address. It makes the instruction load word (lw). Load word (lw) command copies the value stored at a memory address to a destination register. Therefore, thelw assembly language instruction is described by the MIPS fields.

04

Binary representation of instruction

The MIPS instruction is:

op= 0×23, rs = 1, rt = 2, const = 0×4

op specifies the instruction’s operation and is of 6-bits. rs is the source register that is used to specify the register containing the first operand and is of 5-bits. rt is a target register that is used to specify register containing the second operand and is of 5-bits. The last 16-bits are used for address in I-format. The I-format for MIPS is:

oprsrtaddress
10001100001000100000 0000 0000 0100

Hence, The binary representation is 1000 1100 0010 0010 0000 0000 0000 0100 0x8C220004.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Question: [5] Assume for a given processor the CPI of arithmetic instructions is 1, the CPI of load/store instructions is 10, and the CPI of branch instructions is 3.

Assume a program has the following instruction breakdowns: 500 million arithmetic instructions, 300 million load/store instructions, 100 million branch instructions.

2.46.1 [5] <§2.19> Suppose that new, more powerful arithmetic instructions are added to the instruction set. On average, through the use of these more powerful arithmetic instructions, we can reduce the number of arithmetic instructions needed to execute a program by 25%, and the cost of increasing the clock cycle time by only 10%. Is this a good design choice? Why?

2.46.2 [5] <§2.19> Suppose that we find a way to double the performance of arithmetic instructions. What is the overall speedup of our machine? What if we find a way to improve the performance of arithmetic instructions by 10 times?

Write the MIPS assembly code that creates the 32-bit constant 0010 0000 0000 0001 0100 1001 0010 0100 and stores that value to register $t1.

Show how the value 0xabcdef12 would be arranged in memory of a little-endian and a big-endian machine. Assume the data is stored starting at address 0

Provide the type, assembly language instruction, and binary representation of instruction described by the following MIPS fields:

op=0×23, rs=1, rt=2, const=0×4

[5] Consider the following MIPS loop:

LOOP: slt \(t2, \)0, \(t1

beq \)t2, \(0, DONE

subi \)t1, \(t1, 1

addi \)s2, \(s2, 2

j LOOP

DONE:

2.26.1 [5] <§2.7> Assume that the register \)t1 is initialized to the value 10. What is the value in register \(s2 assuming \)s2 is initially zero?

2.26.2 [5] <§2.7> For each of the loops above, write the equivalent C code routine. Assume that the registers \(s1, \)s2, \(t1, and \)t2 are integers A, B, i, and temp, respectively.

2.26.3 [5] <§2.7> For the loops written in MIPS assembly above, assume that the register $t1 is initialized to the value N. How many MIPS instructions are executed?

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free