Basic syntax of assembler syscalls for reading/printing floating point numbers Basic understanding of the floating point unit (Co-Processor 1) and floating point instructions. Some basic instructions and pseudo ops: li.s, add.s, sub.s, mul.s, div.s, etc. Understanding of the basic assembler directives: .data, .text, .asciiz, etc. An understanding of the basic concepts involved in creating functions in assembly: argument registers , return value registers , and the stack/stack pointer, and the f registers. Correct Usage of Registers and the Stack (As described in the handout from the MIPS Programmer's Handbook)
- Program written in any high level language you choose (C, C++, Pascal, Fortran, Cobol, Lisp, Java, etc.) Be sure to comment and fully test this version. For this assignment you need to test your assembly functions and the c language version of that you write. You should also compare against known results (using a calculator or the built-in C functions)
- A revised version of the program with comments and notes indicating how each part will be converted into assembly language. Relevant info would include: where labels will be created and which registers will be used and for what purposes. (Do this prior to writing the MIPS version of the program)
- Program written in MIPS Assembly - This should be well commented
- "Test Cases" - What test cases did you use to verify that you're program worked?
- Sample Runs: Show me the test cases for BOTH your high level language program and the Assemble version. Use your test cases and comment the output to demonstrate that it worked as expected. Your test cases should show that the program did work correctly.
- Match the structure of the generated output as closely as possible
- Answer the following questions:
- What test cases did you use and why? (What was each case meant to test?)
- What mistakes did you make in writing the program?
- How might you revise/improve the program?
- How long did this assignment take you?
- How long did you spend debugging?
- Were there any special debugging techniques that you used?
- Were there any special development techniques that you used?
Summary:Write a versions of the log(), log10(), exp(), and pow() functions similar to the standard C library (math.h) versions.Write the following functions:
m_log:argument 0: the value to find the log (natural log) of. (May be any floaing point number greater than zero (>0)).return value: ln(x) calculated by using the series taylor series.
The taylor series for log(x) =
( x-1 1 (x-1)^3 1 (x-1)^5 1 (x-1)^7 )
log(x) = 2*( --- + - (---) + - (---) + - (---) + . . . )
( x+1 3 (x+1) 5 (x+1) 7 (x+1) )Be sure to write a loop to perform this calculation.
Only the first sixty (60) terms need to be calculated.
No outside function should be called.
Try to be as efficient as possible - don't unnecessarily re-compute anything.
The terms of the equation are: ((x-1)/(x+1))^N, NOT (x-1)^5/(x+1)
m_exp:
argument 0: the value to find the exp (e^x) of. May be ANY floating point number.return value: e^x calculated by using the Maclaurin series.
The Maclaurin series for exp(x) =
2 3 4 5 6 7
X X X X X X
exp(x) = 1 + X + -- + -- + -- + --- + --- + ---- + . . .
2 6 24 120 720 5040Be sure to write a loop to perform this calculation.
Only the first ten (10) terms need to be calculated.
No outside function should be called.
Try to be as efficient as possible - don't unnecessarily re-compute anything.
Look carefully at the denominators to find the pattern that they follow.m_log10:
argument 0: the value to find the log base 10 of. (May be ANY floating point number greater than zero (>0)).m_pow:
return value: the log base 10 of argument 0
To find the log base ten of a number (X), use the properties of logs:
log10(x) = log(x) / log(10)The log base ten just relies on the log base 2.
This function MUST call m_log at least once.
argument 0: The "base" (x)
argument 1: The exponent (y)
return value: The base (x) rasied to the power given by the exponent (y) = (xy)
To compute the "power", you can again, use the properties of logs and exponents:
x^y = e^(y*log(x)) = exp(y*log(x))The pow function MUST call the log function and the exp function.
SPIM Setup:For this program you SHOULD load the trap file
You need to be sure that you are NOT emulating a bare machine