Machine Organization and Assembly Language programming
Problem Set #5 Due: Friday May 9th

In this assignment you'll use the Smok tool to put together a single cycle implementation of the MIPS data path. This is a prelude to the pipeline implementation so you might want to keep this in mind when defining components/containers.

You can work in teams of two if you so desire.

The machine you build should be able to calculate the factorial of a given number, i.e., you need to implement the following instructions (maybe not all of the arithmetic ones are needed but it won't be extra work to do it!):

The code for factorial is given in MIPS assembly language here (it computes 5! but we might want to test your program on different values). The binary, i.e., the .smokmem file is here Note that while MIPS programs start with a PC of 0x04000000, the Smok tool expects a beginning PC of 0x00000000.

Your 32 registers and the PC should be like MIPS's, i.e., 32-bit long. However, we are going to restrict the amount of memory to 1024 Bytes, i.e., 256 words. This explains the beginning of the main program calling the factorial function, i.e., the top of the stack is now at address 1024 (minus 4) and will grow toward address 0.

If you need static and dynamic data, you should start storing them at the 512 byte (128 word) boundary.

In order for us to test your implementation more easily, you should include a ``halt'' component that will be triggered when the self-loop of the main program is reached.

A few Smok-MIPS quirks.

What you have to turnin. More information will be given to you regarding how to name your files etc. but basically you should hand-in (e-mail Tapan):

One turnin per set of partners is enough but be sure to indicate both names.


baer@cs.washington.edu (Last Update: 4/8/03 )