Write the equivalent mips assembly code for the c-code


Assignment Task: The assignment consists of one problem with Q1, Q2 and Q3 to answer. You should compile your answers to Q1, Q2 and Q3 and related results and discussion in a document.

Assignment Problem: The C-code shown below will add the coursework array marks to the exam array marks and store in the results array for one of your modules. The code will also create counters for the number of students with results >= 70, >=60, >=50 and < 50. Assume the number of students is 15.

int A, B, C, F; // declare results counters

int i; // declare loop counter

A=0; B=0; C=0; F=0; // initialize results counters

int coursework []; // coursework is an array to store the coursework marks that goes from 0 to 60.

int exam []; // exam is an array to store the exam marks that goes from 0 to 40.

int results []; // results is an array to store the total marks = coursework + exam. Results goes from 0 to 100.

for (i=0; i

results [i] = coursework [i] + exam [i]

if(results [i] >= 70)

A = A + 1;

else if (results [i] >=60

B = B + 1;

else if (results [i] >= 50

C = C + 1;

else

F = F + 1;

}

Answer the following questions:

Problem 1: Write the equivalent MIPS assembly code for the C-code shown above. Show the assembly code, test the assembly code program via the MARS MIPS simulator and show test results in the report.

Problem 2: Consider the basic MIPS 5-stage pipeline (F, D, EX, M, WB). Assume that there is full forwarding and branch not taken. Does your solution in Q1 have any pipelining hazards? If yes, then list these hazards and show how these hazard(s) can be resolved by rewriting the code you produced in Q1. You should test the rewritten code and provide the new code and the results in the report?

Problem 3: How many instructions will be executed for your code in Q2? If the clock cycle rate of the processor is 1GHz, what is the execution time of your code in Q2?

Note: Please only use Mars stimulator and only use $S and $T and just use $s $t registers.

Don't hesitate to avail top-notch MIPS Assembly Code Assignment Help, Homework Help service from the qualified tutors at the most viable prices that no one in the industry can provide.

Tags: MIPS Assembly Code Assignment Help, MIPS Assembly Code Homework Help, MIPS Assembly Code Coursework, MIPS Assembly Code Solved Assignments

Request for Solution File

Ask an Expert for Answer!!
Other Subject: Write the equivalent mips assembly code for the c-code
Reference No:- TGS03040859

Expected delivery within 24 Hours