CS611
Fall 2002
Final Exam
You must choose one of the following alternatives for your
final exam.
You must send me e-mail no later than 5pm on Monday November 18
to let me know what your choice is.
After that time, you may not change your choice.
If you fail to inform me of your choice, I will make a choice for
you.
Your final exam must be submitted to me prior to 3:30pm on Wednesday
December 18.
NO LATE SUBMISSIONS OF FINAL EXAMS WILL BE ALLOWED.
If you have files to submit, type:
~cs611/bin/submit final list of files...
Electronic copies of documents may be submitted in the same manner.
(Please give me only PDF or Postscript. No Microsoft Word files!)
Alternatively you can hand me hardcopy in person or give the hardcopy
to the Computer Science office staff to place in my mailbox.
- Explain how to implement recursive functions on the IAS machine.
Illustrate your approach by implementing a recursive version of the
factorial function for the IAS machine.
Test your recursive function using the main program in
~cs611/public/IAS/call.asm.
That is, modify call.asm to utilize a recursive factorial
function.
Submit your modified call.asm file.
Put your explanation of how to implement a recursive function in a comment
at the top of this file.
- The IAS machine actually did not have "address modify" instructions.
It was in von Neumann's design but was not implemented.
Explain in detail how to do array operations and subroutine calls without these
instructions.
Be sure to consider both the AMODL and the AMODH instructions.
Demonstrate your solution by modifying ~cs611/public/IAS/call.asm
to not use the AMODL isntruction but to instead use your approach.
Submit your modified call.asm file.
Put your detailed explanation of how to do array operations and subroutine
calls without these instructions in a comment at the top of this file.
By "detailed" I mean I want to see IAS instruction sequences that will
implement these two instructions.
- Von Neumman did not consider the IAS machine to support an integer type.
Rather he viewed the machine as having "fixed-point" arithmetic,
supporting values in the range -1 <= x < 1.
Read the relevant parts of the von Neumann
paper
and explain why this was his point of view.
Also carefully explain the difference between floating-point values
(e.g. IEEE single precision) and von Neumann's fixed-point values.
Finally, explain how to use fixed-point to do a simple calculation,
such as the sum of a vector.
- Write a C function to implement IAS multiplication.
The function should take two 40-bit inputs and produce an 80-bit output.
The parameters should be passed by reference using void* pointers.
You must do this using only 32-bit C integer data types.
(That is, no "long long", no "int64", etc.)
Write a "test rigging" and thoroughly test your function on a Linux/Intel
machine.
Submit files containing the function, the "test rigging" and the tests
you used.
Also submit a Makefile named "Makefile" that for the target "test"
will build and execute your program.
- Write an IAS program that reads a vector of numbers from
cards where the numbers are in binary-decimal format,
Sums the numbers together and then writes the result back
to a card in binary-decimal format.
Feel free to adapt any of my IAS code that you want.
The main point of this project is to write the conversion routines
from programming assignment 1 using IAS assembler.
Submit a file called "convert.asm" that contains your program.
- Write an IAS program to do "code relocation".
This program should "fix" the address fields of another program that
has been loaded into high memory.
The "code relocation" program will be passed the base address of the
second program in the AC register.
Assume the second program has the usual format.
That is, it begins with two header words, the instruction section follows,
and then the data section.
Submit a file called "reloc.asm" that contains your program.
- Write an IAS program to emulate floating-point addition.
Divide a 40-bit IAS word into three components:
bit 39 is the sign bit,
bits 31-38 is the biased exponent,
and bits 0-30 is the significand.
Use 127 for the bias amount.
Assume all significand bits are stored.
That is, there is no "hidden" 1 bit.
When doing the addition, there is no "guard" or "sticky" bits and there
is no rounding of the result.
The program should assume its two inputs are in memory words 2001 and 2002.
The result of the addition should be placed in memory word 2000.
Submit a file called "addfp.asm" that contains your program.
Last modified on December 12, 2002.
Comments and questions should be directed to
hatcher@unh.edu