Question

In: Computer Science

THE CODE IN THIS QUESTION IS STORED IN THE MEMORY FROM ADDRESS 0X1FFF000. SO TAKE THIS...

THE CODE IN THIS QUESTION IS STORED IN THE MEMORY FROM ADDRESS 0X1FFF000. SO TAKE THIS INTO CONSIDERATION.

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: …

********************************THE FOLLOWING QUESTION NEEDS TO BE CONVERTED TO MIPS ASSEMBLY LANGUAGE, WHERE i is stored in $s0 and the array is stored in $s1. ***********************************

2. 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.

Solutions

Expert Solution


Related Solutions

The following code segment is stored in memory starting at memory location 0x00445670. What are the...
The following code segment is stored in memory starting at memory location 0x00445670. What are the two possible values for the contents of the PC after the branch instruction has executed?       bgez $a0, skip                      # mem location: 0x00445670 subu $s2, $s1, $t0 # branch NOT taken (false) ori    $v0, $t1, 0x0003 #       skip: addi $t0, $t1, 2 # branch taken (true) if taken: if not taken: Hint: Remember how many bytes each instructions takes.
use cout to print the address at which the following array is stored in memory long...
use cout to print the address at which the following array is stored in memory long double computers[24] a. print the adress of the last element b. print the address of the tenth element. c. print the address of the first element in the array
How can i modify my c code so that each number stored in the array is...
How can i modify my c code so that each number stored in the array is not the array index but the value of the array index converted to radians. I have already made a function for this converion above main(). Below is the code: #include <stdio.h> #include <stdlib.h> #include <math.h> float Deg2Rad (float degrees) { // Calculate & return value float Result; Result = ((M_PI*degrees)/180.0); return (Result); } int main(void) { // Declare variables int Array[90]; int i; //...
Given a memory address of 34Ah (10 bits) with 4 memory banks. Determine the memory bank...
Given a memory address of 34Ah (10 bits) with 4 memory banks. Determine the memory bank address and the address of the word in the bank using Low Order Interleaving (LOI).
Can you please take this code and just rewrite it so it can be easily be...
Can you please take this code and just rewrite it so it can be easily be able to put into a complier. in java Implementation of above program in java: import java.util.HashMap; import java.util.Scanner; import java.util.Map.Entry; public class Shopping_cart {       static Scanner s= new Scanner (System.in);    //   declare hashmap in which key is dates as per mentioned and Values class as value which consists all the record of cases    static HashMap<String,Item> map= new HashMap<>();    public...
Here is the start of the SAS code to address this question: DATA READING; INPUT GROUP...
Here is the start of the SAS code to address this question: DATA READING; INPUT GROUP $ WORDS @@; DATALINES; X 700 X 850 X 820 X 640 X 920 Y 480 Y 460 Y 500 Y 570 Y 580 Z 500 Z 550 Z 480 Z 600 Z 610 ; Is there a significant difference between the mean reading score among the groups? Yes No Assuming you answer "yes" in the previous question, between what groups was there a...
Why would memory indirect addressing (i.e., the instruction contains a memory address A, which in turn...
Why would memory indirect addressing (i.e., the instruction contains a memory address A, which in turn is a pointer to memory location B which contains the value) be difficult to implement on the hardware in Figure 5.8?
What is Translatinal look-aside buffer (TLB)? What is it for? What is stored in this memory?...
What is Translatinal look-aside buffer (TLB)? What is it for? What is stored in this memory? How can yo distinguish TLB buffer from cache memory?
D-Latch is a simple clocked memory element in which the output is equal to the stored...
D-Latch is a simple clocked memory element in which the output is equal to the stored state inside the element. In D-Latch the state is changed whenever the appropriate inputs change and the clock is asserted. A D-Latch has two inputs and two outputs. The inputs are the data value to be stored and a clock signal that indicates when the latch should read the value on the data input and store it. The outputs are simply the value of...
Give an example of how information gets into memory, is stored over time, and is retrieved...
Give an example of how information gets into memory, is stored over time, and is retrieved when needed.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT