CompOrg Fall 2001

Homework #5 - MIPS Assembly language implementation of Booths Algorithm

Due Date: Monday, Nov 5th by 11:59PM

Assignment

You must provide a MIPS subroutine that implements Booth's Algorithm for multiplication of two 8-bit signed numbers. Your subroutine cannot use any mult instructions, and it must implement Booth's algorithm (multiplication via simple repeated addition is not Booth's algorithm!).

Your subroutine must be named booth and will be passed two 32-bit, signed integers, one in each of $a0 and $a1. Your subroutine can assume that the numbers are in the range -128 to +127 (you only need to do 8 bit multiplication). You must return two values:

Your subroutine may not change any of the S registers ($S0, $S1, ...). Of course you may use these, the idea is that when your subroutine returns, the original values must be restored...

Some things you will need to know

What to turn in, and how to submit

What you need to submit

You should submit your subroutine in a file by itself, do not submit a main or any other test code! We will add our own main (and it will test all possible combinations of inputs!) - all you need to supply is a file that contains your booth subroutine. Important!: Name your file booth.asm

How to submit

Email your submission to comporg-submit@cs.rpi.edu with the subject line "HW5".

Grading

Assembly language is very hard to read! Make sure you provide lots of comments to help us.

Grades will be determine by:

Notes and Hints