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

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.
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...
QUESTION: Add code so that if no parameter values are specified for method “main”, then the...
QUESTION: Add code so that if no parameter values are specified for method “main”, then the error message “file name expected” is printed out instead of the "Opening file " message. Hint: If no parameter values are specified for method “main”, then the length of the array “args” will be zero. If that error message “file name expected” is printed out, the program should stop. You can make any Java program stop using this line … System.exit(0); skeleton code: /**...
9- Show how the word ABCD H is stored in the memory starting at 0A002 H?...
9- Show how the word ABCD H is stored in the memory starting at 0A002 H? 11- How the decimal number 500 is stored in the memory? 13- Which two values are needed for memory address calculations? 15- What are the steps of an instruction execution? Briefly explain each step. please answer all of them I will upvote! 19- Calculate the value of memory address in each case: a) 2000:33BB b) 0200:AA00 c) 0220:00BC 20- A data segment is to...
Discuss flashbulb memories and the idea that all memories are stored permanently in long-term memory.
Discuss flashbulb memories and the idea that all memories are stored permanently in long-term memory.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT