Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

do Solutions for part A and part B in separate files 1. [100pts] The following program (written in C) finds the maximum value of an

do Solutions for part A and part B in separate files

image text in transcribed

1. [100pts] The following program (written in C) finds the maximum value of an array int max, 1j max = array[0]; for (i=0; i size; i++) if ( max array[1] ) max = array[1]; 1.a [50pts] Implement the above C routine in the MIPS assembly language. This part should be written without any urge for optimization 1.b [50pts] Carry out the following optimizations on your program [1525pts] Reorganize the loop so it can be accomplished with one branch instruction instead of two . [4025pts] Replace the array subscripting with pointers as illustrated in the "Arrays versus Pointers section of the text. Instructions: Use the following sample dataset to finish your implementation 0 -4 3 -7 -10 10 -5 47 -9 -1 10 -9 0 6 3 -5 2-4 -0 You might need to define array in the text segment shown below data array: .word , -4, 3, -7, 10, 10, -5, 4, 7,-9 .word -1, 10, -9, 0, 6, 3, -5, 2, -4, -0 Also, in your text segment, you have to load the address of array by using "la $t1, array" From there, you should be able to implement your algorithm

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

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions

Question

Can workers be trained in ethics? How? Defend your answer.

Answered: 1 week ago