Question: Problem 1: Performance Instruction Type Arithmetic Logical Loads Stores Conditional branches3 Unconditional jumpsdles tomatO: Cycles sit $to, $al, $a2 sto, $zero, orange add $ti, $a0,
Problem 1: Performance Instruction Type Arithmetic Logical Loads Stores Conditional branches3 Unconditional jumpsdles tomatO: Cycles sit $to, $al, $a2 sto, $zero, orange add $ti, $a0, $t1 6 s1l $t2, $a2, 2 add $t2, $a0, $t2 add $ts, $al, $zero andi $ts, $t5, 1 beq $ts, $zero, potato 1w $t3, 0($t1) add $t4, $t3 $t3 sw $t3, 0(St2) sw $St4, 0 ($t1) Table 1. Number of clock cycles for each type of instruction potato: addi Sai, sal, 1 addi $a2, $a2, -1 tomato $ra orange: jr Part (o) Above is the assembly code for the function declared as: tomato(int arrayl, int x, int y). Ass is an array of 500 integers, and the function is called as tomato(myarray, 4, 22). int array), int x, int y). Assume that "myarray ) How many times is the "slt" instruction executed? Justify your answer to rece () How many times is the "lw" instruction executed? Justify your answer to receive 4, 22). Show your work (20 points)? Part (b) Calculate the total number of cycles it takes to execute tomato(myarray, Problem 1: Performance Instruction Type Arithmetic Logical Loads Stores Conditional branches3 Unconditional jumpsdles tomatO: Cycles sit $to, $al, $a2 sto, $zero, orange add $ti, $a0, $t1 6 s1l $t2, $a2, 2 add $t2, $a0, $t2 add $ts, $al, $zero andi $ts, $t5, 1 beq $ts, $zero, potato 1w $t3, 0($t1) add $t4, $t3 $t3 sw $t3, 0(St2) sw $St4, 0 ($t1) Table 1. Number of clock cycles for each type of instruction potato: addi Sai, sal, 1 addi $a2, $a2, -1 tomato $ra orange: jr Part (o) Above is the assembly code for the function declared as: tomato(int arrayl, int x, int y). Ass is an array of 500 integers, and the function is called as tomato(myarray, 4, 22). int array), int x, int y). Assume that "myarray ) How many times is the "slt" instruction executed? Justify your answer to rece () How many times is the "lw" instruction executed? Justify your answer to receive 4, 22). Show your work (20 points)? Part (b) Calculate the total number of cycles it takes to execute tomato(myarray
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
