Score:_______ Date:_____ Name:__________________________ Section: ________ Lab Partner: _______________________________________ TA Signoff:_______________________________________ ECE 3055 Laboratory Assignment 1 Due Date: Tuesday, September 14 Write a MIPS assembly language program that computes the parity of a number you type in. Your program should prompt the user to enter an integer n , and then calculate and print the result stating the “ n has even parity” or “ n has odd parity”. You can assume that n is a positive integer such that it is small enough to be represented by a 32-bit 2’s complement number. The program code that calculates the parity must be in a subroutine ( i.e JAL to Call from main program, JR $31 to Return). Pass and return values to the subroutine in registers. $a0 is the number to compute the parity of, and $a1 returns a flag to the main program. The flag value is 1 for odd parity and 0 for even parity. Keep all I/O operations in the main program and you
This is the end of the preview. Sign up
access the rest of the document.
This note was uploaded on 01/27/2011 for the course ECE 3055 taught by Professor Staff during the Spring '08 term at Georgia Tech.