Question: Project 1: In this project we will learn MIPS assembly language to implement the following HLL: void merge(int a[], int low, int high, int mid){
Project 1:
In this project we will learn MIPS assembly language to implement the following HLL:
void merge(int a[], int low, int high, int mid){
int i, j, k;
i = low;
k = low;
j = mid + 1;
while (i <= mid && j <= high){
if (a[i] < a[j]){
c[k] = a[i];
k++;
i++; }
else{
c[k] = a[j];
k++;
j++; }
}
while (i <= mid){
c[k] = a[i];
k++;
i++; }
while (j <= high){
c[k] = a[j];
k++;
j++;
}
for (i = low; i < k; i++){
a[i] = c[i];
}
}
Objective of this project is to understand: Points
How to implement and call a leaf function (method) 20 pts
How to use arrays as arguments to the function . 10 pts
How to iterate over the array index to access the elements from memory addresses .. 10pts
How to declare the variables ...... 10pts
How to implement while loop, for loop and if-else constructs 10pts
How to implement conditionals checking inside these constructs . 10pts
How to use SPIM simulator (MARS or QtSPIM) .. 10pts
Running the code with test inputs (two sorted arrays) .10pts
Answering the questions in the Demo for originality of work .10 pts
Test Input: Consider the array [1,4,7,10,25,3,5,13,17,21].
Hint: The first and second halves of this array are both already sorted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
