Can someone help me with this MIPS problem. Write a MIPS code that finds the min
ID: 3599695 • Letter: C
Question
Can someone help me with this MIPS problem.
Write a MIPS code that finds the minimum, maximum, sum and average of an array A. In your code, you need to load array A base address in the $s1 register. Once your code completes its execution, minimum, maximum, sum and average will be stored in $s2, $s3, $s4 and $s5 registers, respectively.
Hint:
You can declare arrays with initialization list with the following MIPS declaration.
.data
A: .word 10, 160, 20, 70, 60, 140,150, 80, 90,100, 110, 30, 40, 120,130, 50
Asize: .word 16
ShiftAmount: .word 4
You can assume that the array size is power of 2. You can use shift operation for division calculation. You can use the ShiftAmount variable to specify the total shift.
Also I need to compute the median of the array.
Explanation / Answer
Solution: