For the problems in this exercise, the breakdown of executed…

For the problems in this exercise, the breakdown of executed instructions is as follows:   add addi nor beq lw j-type(jr/jal) sw 20% 15% 15% 20% 10% 5% 15% (a)  In what overall fraction is the data memory used?  (b)  In what overall fraction is the instruction memory used? (c)  In what overall fraction is the program counter (PC) used? (d)  In what overall fraction is the ALU/adder used? (e)  In what overall fraction is the sign extension unit used? (Note: sign extension is used when a constant or an address offset is provided inside an I-format instruction in 16-bit format but before working with it we need to convert it a 32-bit constant or address offset)   For full credit please provide the expression when you are adding the percentage to generate the results.

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. for main and 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. 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.