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 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. 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). Your program should be well commented. Requirements and Suggestions: The following steps are required to complete the assignment. You are required to use iteration.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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.
  1.  
  • 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
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
Transcribed Image 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY