$35
1
Final Project
Program 1: (25 points) Create a MIPS assembly code that reads two positive integers A, and B as
input parameters and computes the below F expression. The code shall execute in MARS to prompt
the user to enter two positive integers, each separated by Enter key. The program shall execute the
below equation.
𝑭 = 𝑨 𝒙 𝑩
The code should be executed in MARS to prompt the user to enter two positive integers, each
separated by the Enter key. The program should calculate F using multiplication procedures and
output F as floating-point number by using syscall routines.
Note: No multiplication and division {mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu,
rem} are allowed to be used.
Output Sample
A B F
1 2 2
10 4 40
Program 2: (25 points) Create a MIPS assembly code that reads three signed numbers a, b, and c
as input parameters. The code shall execute in MARS to prompt the user to enter three signed
integers represented in decimal, each separated by Enter key. The program shall execute the below
equation.
𝑭 =
(𝒂 + 𝒃
𝒄
)
(𝒄 − 𝒂𝟐)
+ (𝟑 ∗ 𝒃)
2
Notes:
a. Your program should print the output out on the screen.
b. Your program should stop if the division by zero occurs.
c. Your program should also check if there is any overflow and print a message “Overflow” if
yes. If no overflow, the program should print “No overflow”.
Output Sample
a b c Q R Message
0 2 2 8 0 No overflow
0 -4 2 -4 0 No overflow
-2 15 4 Division by zero
Program 3: (25 points) Create a MIPS assembly code that calculates the CPU execution time
(equation is given below) for two processors, and find which processor is faster. The code shall
execute in MARS to prompt the user to enter Instruction Count, CPI (Clock Per Instruction), Clock
Rate (in GHz) for each processor as floating-point single-precision numbers. The program should
print out which processor is faster and by how much.
𝑪𝑷𝑼 𝑻𝒊𝒎𝒆 =
𝑰𝒏𝒔𝒕𝒓𝒖𝒄𝒕𝒊𝒐𝒏_𝑪𝒐𝒖𝒏𝒕 𝒙 𝑪𝑷𝑰
𝑪𝒍𝒐𝒄𝒌_𝑹𝒂𝒕𝒆
Output Sample
Processor A Processor B
Output IC CPI Clock
Rate
IC CPI Clock
Rate
100 2.0 4GHz 100 1.2 2GHZ A is 1.2 times as fast as B
100 4 4GHz 100 2.0 4GHz B is 2 times as fast as A
3
Report Content (90 points):
You are required to provide the answers for the following numbered section headings:
1.0 Program Input/Output (20 points): Describe (or list) the inputs and outputs of each
program.
2.0Program Design (20 points): Describe how each code (program 1, program 2 and
program 3) operates.
3.0Symbol Table (20 points): Create a 2-column Table describing all Registers used and their
specific Purpose in the code, where each registeris listed on a separate row and identified by
register name $t0, $s0, etc., and Labels used and their purpose on separate rows.
4.0Learning Coverage (10 points): Provide a list of at least 5 technical topics learned
from this project. Don’t replicate the technical topics that you listed in the previous
homework.
5.0Test Results (20 points):
5.1Programs: Provide screen shot(s) of two 2 proper MIPS code executions in
MARS for your Test Plan inputs. To illustrate, you are required to execute each
code (program 1, program2, program 3) at least 2 times. In each time, you enter
different input sets, and you get different outputs. Take a screen shot of each
execution (“MARS Message” console) and include it in your report.
Project Submission
1. Create a folder and name it as p3_username, where username is youruniversity
username.
2. In MARS, save the code of program 1 as c1.asm, save the code ofprogram 2 as
c2.asm and program 3 as c3.asm.
3. Save your report as a PDF file and name it as p3_report.pdf.
4. Place the three asm files and the report document inside p3_usernamefolder.
5. Compress (or zip) the folder. Then, upload the compressed folder on Blackboard.