Question: 4 . ( 1 0 pts ) Consider the following program to find the maximum or the minimum in a list of numbers based on

4.(10 pts) Consider the following program to find the maximum or the minimum in a list of numbers based on a setting of the flag variable: Int min = A[1] Int max = A[1] Boolean flag = false If (flag = false) for i =2 to n if (Ai]< min) min = All return(min)1 instruction 1 instruction 1 instruction 1 instruction /3 instructions 1 instruction /1 instruction 1 instruction } Else for i =2 to n if (Ali]> max) max = Ali] return max)3 instructions //1 instruction 1 instruction 1 instruction a. Find the total number of instructions needed to execute the program (2 pts)2 American University of Sharjah | College of Engineering Department of Computer Science and Engineering COE 341- Computer Architecture b. Assuming clock cycle is 5ns, find the total time to execute the program on: i. CISC machine where: Each instruction is 5 cycles; and comparison and assignment can be implemented in one instruction. (4 pts)i. RISC machine where each instruction is 3 cycles (3 points) iii. Which architecture is more suitable to implement the program? (1 point)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!