Show the pipeline execution table of your code from Q1.  Based on the pipeline execution table, does your solution in Q1 have any pipelining hazards? 

COMPUTER ARHITECTURE

Q1 Use the MIPS instruction set and the MARS MIPS simulator to:
Write the equivalent MIPS assembly code for the C-code shown above. Remember to add comments to your assembly code.
Test the assembly code program via the MARS MIPS simulator.
Show the assembly code and all test results of running the assembly code in the report.

Q2    Consider the basic MIPS 5-stage pipeline (IF, ID, EX, MEM, WB).  Assume that there is full forwarding and branch not taken.

Show the pipeline execution table of your code from Q1.
Based on the pipeline execution table, 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.
If your code from Q1 does not have any pipeline hazards, discuss why this is the case and how did you resolve the pipeline hazards issues in Q1.

Q3    Performance measurement.
How many instructions will be executed for your code in Q1 without optimisation?
Optimise using inline expansions and loop unrolling to use a minimum number of instructions in to run your assembly code and explain the methods done.
How many instructions will be executed for your code with optimisation conducted?