Remember you MUST show your work for all problems on the tes…

Remember you MUST show your work for all problems on the test to receive credit.  Failure to properly show your mathematical justification for the answer you have chosen will result in no credit given for that question.  Be sure your work is numbered, can be read clearly, and is in order. Your work must be submitted in the Final Exam Work assignment immediately after submitting your test. 

In this exercise, we examine how data dependencies affect ex…

In this exercise, we examine how data dependencies affect execution in the basic 5-stage pipeline described. Problems in this exercise refer to the following sequence of instructions: I1: lw $r1,36($r2) I2: add $r2,$r1,$r4 I3: and $r5,$r1,$r2 [3 points] Indicate dependencies that can cause data hazards. Mention the register involved.

Translate the functions main and func into MIPS assembly lan…

Translate the functions main and func into MIPS assembly language. If you need to use registers $t0 through $t9, use the lower-numbered registers first. [6 points] for main and [6 points] for max. Assume the function definition for a leaf function max is  int max(int a, int b) { if (a>b)     return a; else     return b; } The code for the function main is as follows:int main() {    int p=5;    int q = 23;    int result = max(p,q) ; }   main:             j End max:          jr $ra End: All the parameters use registers $a0 through $a3 and the result should be returned using $v0. The variables p and q are represented by $s0 and $s1. The variable is represented by $s2. [You need to load the values of 5 and 23 into s1 and s2 before calling the procedure.] Also, before using any s (s0 – s7) registers from the procedure max (in case you plan to use) make sure to push the content of the registers to the stack and pop the content once you are done using the register i.e. just before calling jr $ra from the max procedure. The best way to avoid using a stack is to use any t-registers in the procedure max and s-registers inside the main.