Assignment 10, due Jul 17
Part of
the homework for CS:2630, Summer 2018
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (Tuesday or Thursday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
sin x = | 16 x ( π – x ) |
5 π 2 – 4 x ( π – x ) |
In the following, you can assume that the floating point unit is already turned on and that it is running in single-precision mode. Assume that the following floating point constants needed to evaluate the above are available and assembled into memory near your code:
ALIGN 4 F4: W 4.00 in IEEE floating point format F16: W 16.00 in IEEE floating point format FPI: W PI in IEEE floating point format F5PI2: W 5.00 * PI * PI in IEEE floating point format
A problem: Write a SMAL Hawk subroutine using the HAWK floating point unit that implements Bhaskara I's approximation of the sine function. This should take the parameter x in R3 and return the approximate sine of x in R3. Your code can use both floating point accumulators and it should conform to the standard Hawk calling sequence and the standard assumptions about subroutine register usage. (1.5 points)
a) 40800000 (0.3 points)
b) 40A00000 (0.3 points)
c) 41800000 (0.3 points)
d) 40490FDB (0.3 points)
e) 42456460 (0.3 points)
Note that there are on-line IEEE calculators that can help you check your results, but note also that on the next midterm, you will be given a greatly simplified floating point format and asked to solve a related problem without use of any tools more powerful than pencil and paper.