Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve using MIPS 1. Find the sum of the main diagonals left to right and right to left, sum of all elements in a two

Solve using MIPS image text in transcribed
1. Find the sum of the main diagonals left to right and right to left, sum of all elements in a two dimensional array of N X N. Write a main program and 3 sub programs to sum efficiently, 1- left to right diagonal, 2-right to left diagonal, 3-sum of all of the elements in the matrix. The main program output a message for the user to input a value of N where N is greater than or equal to 2 and less than or equal to 5. Based on the value of N the main program will also ask user to input and get N X N positive integer numbers which will be stored in a dynamic or static array of your choice. The main program then passes using a stack the value of N and the address of the array which represents the matrix to the three sub programs. Each sub program passes the sum to the main program using stack or any register. Finally output with proper messages the value of N, N X N matris array, left to right diagonal sum, right to left diagonal sum, and Total sum of all elements in the matrix. Run your program for two different values of N and print output. Rules: 1. Your Name, date, program name. 2. Pseudo code is optional but will help you. 3. How and what registers and stack pointers used is optional. 4. Every instruction with a comment as to what you are planning to accomplish is required. 5. Submit 1. Source program 2. Two outputs for two values of N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago