


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Computer Arch & Oper Sys; Subject: Electrical & Computer Engr; University: Georgia Institute of Technology-Main Campus; Term: Summer 2007;
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Due Date: 11:59 pm, Monday June 4th^ , 2007.
To understand and apply shift, masking, and logical operations and the MIPS 32 procedure calling conventions
You will write a SPIM program that performs arithmetic on packed byte values. Recall that four byte values can be packed into one word. Using the .byte data directive store an array of 64 byte values (pick your own values) in the data segment. Use the. word directive if you like. If we are initializing the byte array to random values you can see that it does not really matter whether we use the. byte or. word directives!
Compute a new byte array which we will designate as the output array. This array is also packed into words. The values in this array denote the location of “edges” in the original array. An element at index i in the original array is an edge if the difference between element i and element i+1 is greater than a threshold value. For example consider the sequence of element values as follows.
2 4 3 8 5 2 9 1 1.....
The edge values for a threshold of 4 will be
0 0 1 0 0 1 1 0.....
Your program should query the user for a threshold value and only accept values between 0-63. If the value falls outside this range, the user should be queried again.
Your solution should have the following procedures and control structure.
Some overall points and suggestions:
Email a text file (with a .s or .asm extension) the TA by 11:59 pm, Monday, June 4 th^ ,
Grading Guidelines
For your information here are the grading guidelines for the SPIM component of the assignment.
a. How much space is occupied in the data segment and text segment by the above program? b. What are the values of loop, Blank, and L2? c. Provide the hexadecimal encoding of the bne instruction.
Email a PDF file to the TA by 11:59 pm, Monday, June 4th^ , 2007. The PDF file can be a word file or a scanned PDF from handwritten solutions (please make sure it is legible). You can combine this in the same file as your SPIM submission.