Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1: Performance tomato: Instruction Type Arithmetic Logical Loads Stores Conditional branches 3 Unconditional jumpstor alt $to, $al, $a2 Cycles beq sto, szero orange add

image text in transcribed
image text in transcribed
Problem 1: Performance tomato: Instruction Type Arithmetic Logical Loads Stores Conditional branches 3 Unconditional jumpstor alt $to, $al, $a2 Cycles beq sto, szero orange add $t1, $a0, $t1 sll $t2, $a2, 2 add $t2, $a0, $t2 add $t5, $al, $zero andi $ts, $t5, 1 beq $ts, Szero, potato 1 $t3, 0(stll add $t4, $t3 $t3 6 Table 1. Number of clock cycles for each type of instruction sw t4, 0($t1) potato: addi $al, $al, 1 addi $a2, $a2, -1 tomato orange: r Sra Part (a) Above is the assembly code for the function declared as: tomato(int arrayl), int x, int y is an array of 500 integers, and the function is called as tomato(myarray, 4, 22) (0)How many times is the "slt" instruction executed? Justify your answer to receive credit. (6pts) to receive credit. (6 pts)? () How many times is the "lw" instruction executed? Justify your answer 2). Show your work (20 points)? Part (b) Calculate the total number of cycles it takes to execute tomato(myarray, ,2 Problem 1: Performance tomato: Instruction Type Arithmetic Logical Loads Stores Conditional branches 3 Unconditional jumpstor alt $to, $al, $a2 Cycles beq sto, szero orange add $t1, $a0, $t1 sll $t2, $a2, 2 add $t2, $a0, $t2 add $t5, $al, $zero andi $ts, $t5, 1 beq $ts, Szero, potato 1 $t3, 0(stll add $t4, $t3 $t3 6 Table 1. Number of clock cycles for each type of instruction sw t4, 0($t1) potato: addi $al, $al, 1 addi $a2, $a2, -1 tomato orange: r Sra Part (a) Above is the assembly code for the function declared as: tomato(int arrayl), int x, int y is an array of 500 integers, and the function is called as tomato(myarray, 4, 22) (0)How many times is the "slt" instruction executed? Justify your answer to receive credit. (6pts) to receive credit. (6 pts)? () How many times is the "lw" instruction executed? Justify your answer 2). Show your work (20 points)? Part (b) Calculate the total number of cycles it takes to execute tomato(myarray, ,2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

=+ Are there additional forms of employee representation?

Answered: 1 week ago

Question

=+What is the nature of their impact?

Answered: 1 week ago

Question

=+Is it possible to operate union-free?

Answered: 1 week ago