Calculator.doc

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI 136 Project 2 – A Simple Integer Calculator Due date: 11:59PM, March 10 2005 Objective: Learn how integer multiplication and division are implemented in hardware. Description: You are to write a MIPS assembly program that functions as a simple calculator. Your calculator will read 2 integer numbers from the SPIM console and then an operation. You must support addition, subtraction, multiplication, and division. You are NOT allowed to use any form of MIPS multiplication or division instructions ( mulou, mul, multu, mulo, divu, div ). You will implement a Chapter 3 multiplication and division algorithm using shifts, addition and subtraction, etc. Your program will use the SPIM syscall I/O support to read a number from the console, then read another number, and finally the operator (as a string). You can assume that all numbers are entered correctly, so you don’t need to do any error checking on the numbers. You should print out an error message if the operation specified by the user is not one of the 4 listed below.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern