Docsity

Assignment 1 for Computer Architecture | ECE 484, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
ECE 484/584 Spring 2005
Homework Assignment #1
In this assignment you are responsible for writing three MIPS subroutines and a stub
calling function (main) using the PCSPIM simulator.
The stub calling function must be named “main” and will use two values placed into
registers $s0 and $s1 by the grader. One subroutine will compute the product of these
two registers ($s0 * $s1) using the final version of the multiplication algorithm developed
in class. This subroutine will return the product and an overflow indication flag to main.
The product must be placed into register $s6 and the overflow flag must be placed into
register $s7 when returned to main. A value of one indicates overflow, a value of zero
for the flag indicates no overflow.
The second subroutine will use the values placed into registers $s0 and $s1 and will
compute the product ($s0 * $s1) using Booth’s algorithm. The product will be returned
to $s4 and the overflow flag will be returned to register $s5 in main. Again, a value of 1
= overflow and a value of 0 = no overflow.
The third subroutine must use the same values placed in registers $s0 and $s1 and return
the quotient and remainder from the division operation $s0/$s1 using the algorithm
developed in class. The quotient must be placed into register $s2 and the remainder into
register $s3 when returned to main.
REQUIREMENTS:
1) No more than three (3) temporary registers can be used in each subroutine.
2) No form of any MIPS multiply or divide instruction is allowed including real
MIPS instructions and pseudo-instructions signed or unsigned.
3) The assignment is due on or before March 18, 2005 by 12:00 p.m. Each
student must demo the program to Smita Potdar BEFORE the deadline. The
computers in the ECE labs (Houser Hall rooms 221 and 222) can be used, or you
can use a personal laptop for demonstration purposes. Late assignments will not
be accepted.
4) You should use the standard MIPS conventions for register usage and preserve
only those registers that should be preserved across a function call.
Smita will use a standard set of test data that she will input to the appropriate registers
($s0 and $s1) just before executing your code. She will then verify that the correct
results are located in the correct registers during and upon the completion of your code.
She will also verify that all the requirements were followed. Violation of requirements 1-
3 will result in a zero for the assignment. Violation of requirement #4 will be graded
based upon the severity of the problem.

Partial preview of the text

Download Assignment 1 for Computer Architecture | ECE 484 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

ECE 484/584 Spring 2005 Homework Assignment # In this assignment you are responsible for writing three MIPS subroutines and a stub calling function (main) using the PCSPIM simulator. The stub calling function must be named “main” and will use two values placed into registers $s0 and $s1 by the grader. One subroutine will compute the product of these two registers ($s0 * $s1) using the final version of the multiplication algorithm developed in class. This subroutine will return the product and an overflow indication flag to main. The product must be placed into register $s6 and the overflow flag must be placed into register $s7 when returned to main. A value of one indicates overflow, a value of zero for the flag indicates no overflow. The second subroutine will use the values placed into registers $s0 and $s1 and will compute the product ($s0 * $s1) using Booth’s algorithm. The product will be returned to $s4 and the overflow flag will be returned to register $s5 in main. Again, a value of 1 = overflow and a value of 0 = no overflow. The third subroutine must use the same values placed in registers $s0 and $s1 and return the quotient and remainder from the division operation $s0/$s1 using the algorithm developed in class. The quotient must be placed into register $s2 and the remainder into register $s3 when returned to main. REQUIREMENTS:

  1. No more than three (3) temporary registers can be used in each subroutine.
  2. No form of any MIPS multiply or divide instruction is allowed including real MIPS instructions and pseudo-instructions signed or unsigned.
  3. The assignment is due on or before March 18, 2005 by 12:00 p.m. Each student must demo the program to Smita Potdar BEFORE the deadline. The computers in the ECE labs (Houser Hall rooms 221 and 222) can be used, or you can use a personal laptop for demonstration purposes. Late assignments will not be accepted.
  4. You should use the standard MIPS conventions for register usage and preserve only those registers that should be preserved across a function call. Smita will use a standard set of test data that she will input to the appropriate registers ($s0 and $s1) just before executing your code. She will then verify that the correct results are located in the correct registers during and upon the completion of your code. She will also verify that all the requirements were followed. Violation of requirements 1- 3 will result in a zero for the assignment. Violation of requirement #4 will be graded based upon the severity of the problem.