Question

This is a homework assignment for Computer Architecture and some question use MIPS Assembly language. 1.    ...

This is a homework assignment for Computer Architecture and some question use MIPS Assembly language.

1.     In the following MIPS assembly code, translate all the instructions to their corresponding machine code in hexadecimal format. This code is stored in the memory from address 0x1fff0000.
Loop: sw $t1, 4($s0)
       addi $t1, $t1, -1
   sll $t1, $t1, 2
       bne $t1, $s5, Exit
   addi $s0, $s0, 4
         j Loop
Exit: …

2.     Find the MIPS instruction with the machine code 0x02108020.

3.     Find the decimal value of the 2's complement number 0xffffffab.

4.     Compile the following C code into MIPS:

i=0;  

        while (i<=100) do

            A[4*i]=0;  

        where integer i is in register $s0 and the base memory address of array A is in$s1.

Homework Answers

Answer #1

Low level computing construct is utilized to compose programs as far as the essential operations of a processor. This is an instructional exercise in the low level computing construct for the MIPS32 processor chip. This instructional exercise utilizes the SPIM test system of the chip as opposed to real equipment.

The design of a PC is a legitimate portrayal of its parts and its fundamental operations. In unadulterated low level computing construct one low level computing construct proclamation compares to one essential operation of the processor. At the point when a software engineer writes in low level computing construct the developer is requesting the fundamental operations of the processor. The design of the processor is obvious in each announcement of the program.

Immaculate low level computing construct is uncommon. Most application projects are composed in an abnormal state dialect. Notwithstanding when low level computing construct is utilized it for the most part has been upgraded. Elements are added to it to make it more software engineer well disposed. This broadened low level computing construct incorporates explanations that compare to a few essential machine operations. The MIPS augmented low level computing construct does this, however the processor chip is still obvious.

Programs in abnormal state dialects, for example, C or Pascal are (for the most part) free of the processor they keep running on. Programs in Java are absolutely free of the processor. In any case, in low level computing construct the program is composed absolutely as far as the processor. This section begins a voyage through low level computing construct.

Section Topics:

The Basic Computer Cycle

Machine Instructions

Machine Language

Low level computing construct

Dialect Translation

Imitating

Protest Modules and Load Modules

Isolate Assembly

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
Question 1. Answer the following questions on MIPS Instruction Set. a) Show the minimal sequence of...
Question 1. Answer the following questions on MIPS Instruction Set. a) Show the minimal sequence of MIPS instruction for the following pseudocode segment: A[3] = A[10] + B; Assume that B corresponds to register $t3 and the array A has a base address of 1000C41016 which is required to be loaded to register $t0 in your code. Provide comments for each line of your MIPS instruction. b) Assume that Loop starts at memory location 0xC010. Provide a) instruction format of...
Consider the following MIPS assembly instructions: andi $s0, $t1, 65 a) What will be the machine...
Consider the following MIPS assembly instructions: andi $s0, $t1, 65 a) What will be the machine code for the assembler instruction? Justify the answer and state it in hexadecimal form. b) In which building blocks in the processor are the pieces in the machine code for the assembler instruction above used?
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022...
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022 ori $t0, $t0, 2048 srl $t1, $t0, 18 sw $t0, 101($t1) slti $t2, $t1, 5 beq $t2, $0, label3 label2:... ... label3:... a) The code modifies a word in memory at the following address (circle one): (i) 1022 (ii) 101 (iii) 5 (iv) 10220000 (v) Other (provide your own answer): _________________ b) The following value is stored in memory (circle one): (i) 0x17 (ii)...
2. (7 pts) Translate the following block of C code to MIPS assembly: if (i >...
2. (7 pts) Translate the following block of C code to MIPS assembly: if (i > 10) MemArray[i] = 0; else MemArray[i] = - MemArray[i]; Assume that the variable i is bound to register $t0, and that the base address of array MemArray is in register $s0.
I'm trying to write a nested loop in Mips Assembly that prints out, for example, if...
I'm trying to write a nested loop in Mips Assembly that prints out, for example, if user input x was 5: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 (spaces in between) So far my code is : li $v0, 5   #Ask for integer syscall move $t5, $v0 addi $t0, $zero, 0 For1:    slt $t1, $t0, $t5    beq $t1, $zero, Exit    add $s0, $s0, $t0    addi $t0, $t0, 1...
Can i get the answer to these questions in detail explaining how you go to the...
Can i get the answer to these questions in detail explaining how you go to the solution 1.Convert to/from Hex (0) 2.Octal Binary Unsigned/ 2’s complement 3.Understand how to shift and rotate. 4.Understand the relationship between shifting and multiplication/division 5.Be able to recognize and use the following gates: AND OR NOT NAND NOR XOR 6.Understand how a half adder works Given a logical statement ((A OR B) AND NOT(C OR A)) show the gates. 7.What is the difference between an...
The C++ program steps through the array x[]. For each i, if x[i] < x[i+1], i...
The C++ program steps through the array x[]. For each i, if x[i] < x[i+1], i is saved in the array ascend[], in order. Compile and run the program; it should print 0 4 5. In this exercise, you’ll try to translate the C++ program to MIPS. Some of the more tedious parts are already given in Assignment3.F19.s. You won’t have to write the data allocation sections, some of the initializations, and the output loop at the end. So the...