This programming assignment is just to reacquaint you with the MIPS instruction set. Write a SPIM program that will compute the maximum value of each column of the matrix stored in row major order...


This programming assignment is just to reacquaint you with the MIPS instruction set.



  1. Write a SPIM program that will compute the maximum value of each column of the matrix stored in row major order starting at the location labeled

    Original

    in the starter template below. The results should be stored starting at the location labeled

    Max
    . The arrays we use will be 4x4 elements. Here is the program template to help you get started.

  2. The program should include a block of code that prints both the original matrix in row major order and the maximum values (one for each column).

  3. Your program should be well commented.



Requirements and Suggestions:




  1. The following steps are required to complete the assignment.



  • You are required to use iteration.

  • You are required to use at least one procedure.






  • Understand the layout of the matrix in memory. How addresses differ between elements of a row or column?

  • Perform register allocation: decide which registers you will use and for what purpose, e.g., loop count.

  • Refine the algorithm description in terms of registers and memory addresses

  • Write and test blocks of code first. For example,

    • A block of code that prints a row to the screen (do not forget the spaces!)

    • A block of code that prints the matrix to the screen (row at a time)

    • Writing these loops is a good precursor for the remaining loops.

    • Test a loop for finding the maximum in a column.



  • Use breakpoints to help in debugging.

  • Use single step mode as the final resort in debugging. It is time consuming but gives you the most information.




Assign_03_w2021 (Protected View) - Word<br>Osama Bzour<br>国<br>File<br>Home<br>Insert<br>Design<br>Layout<br>References<br>Mailings<br>Review<br>View<br>Help<br>O Tell me what you want to do<br>2 Share<br>Assignment Three<br>This programming assignment is just to reacquaint you with the MIPS instruction set.<br>1. Write a SPIM program that will compute the maximum value of each column of the matrix stored in row<br>major order starting at the location labeled Original in the starter template below. The results should be<br>stored starting at the location labeled Max. The arrays we use will be 4x4 elements. Here is the program<br>template to help you get started.<br>.data<br>.asciiz “Original Array:\n

Extracted text: Assign_03_w2021 (Protected View) - Word Osama Bzour 国 File Home Insert Design Layout References Mailings Review View Help O Tell me what you want to do 2 Share Assignment Three This programming assignment is just to reacquaint you with the MIPS instruction set. 1. Write a SPIM program that will compute the maximum value of each column of the matrix stored in row major order starting at the location labeled Original in the starter template below. The results should be stored starting at the location labeled Max. The arrays we use will be 4x4 elements. Here is the program template to help you get started. .data .asciiz “Original Array:\n " .asciiz "Second Array:\n: " strA: strB: newline: .asciiz "In" space : .asciiz “ # This is the start of the original array. Original: .word 200, 270, 250, 100 .word 205, 230, 105, 235 90, 205 80, 205, 110, 215 .word 190, 95, .word # The next statement allocates room for the results in 4*4 = 16 bytes. Маx: space 16 .align 2 -globl main .text main: # Your fully commented program starts here. 2. The program should include a block of code that prints both the original matrix in row major order and the maximum values (one for each column). 3. Your program should be well commented. Requirements and Suggestions: 1. The following steps are required to complete the assignment. You are required to use iteration. You are required to use at least one procedure. 2. Suggestions. • Understand the layout of the matrix in memory. How addresses differ between elements of a row or column? Perform register allocation: decide which registers you will use and for what purpose, e.g., loop count. Refine the algorithm description in terms of registers and memory addresses Write and test blocks of code first. For example, A block of code that prints a row to the screen (do not forget the spaces!) A block of code that prints the matrix to the screen (row at a time) o Writing these loops is a good precursor for the remaining loops. o Test a loop for finding the maximum in a column. Use breakpoints to help in debugging. Use single step mode as the final resort in debugging. It is time consuming but gives you the most information. Page 1 of 2 330 words 100% 3:38 PM A G 1) ENG 5/1/2021

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here