write your own MIPS program that allocates space for two integer arrays (P and Q) of size 9 each. You can use pointers or indices for traversing arrays. The program should do the following: a. Read in the value of N (a digit between 1 and 9, the actual working size of your array). b. Read in from the keyboard the first N values of the array P. Note that we want both arrays P and Q to have identical elements (see the example below for additional explanation). c. Output to the console the N values of both arrays P and Q (use any format and additional text you like). Textbook i use is "Computer Organization and Design 4th Edition by John L hennesy Example: let’s say that the digit read from the keyboard was 3. This means that N=3; them our program will initialise two arrays with elements P[0], P[1], P[2] and Q[0], Q[1], Q[2]. Elements of the arrays are to be read from the keyboard, let’s assume that they were: 25, 11 and 2. The arrays are to be initialised as following: Q[0]=25 Q[1]=11 Q[2]= 2 P[0]=25 P[1]=11 P[2]= 2 the best approach is to write a small program implementing only task 2a as described above, and once you are happy that it works correctly, add code to your program to perform task 2b, and so on
write your own MIPS
a. Read in the value of N (a digit between 1 and 9, the actual working size of your array).
b. Read in from the keyboard the first N values of the array P. Note that we want both arrays P and Q to have
identical elements (see the example below for additional explanation).
c. Output to the console the N values of both arrays P and Q (use any format and additional text you like).
Textbook i use is "Computer Organization and Design 4th Edition by John L hennesy
Example: let’s say that the digit read from the keyboard was 3. This means that N=3; them our program will initialise two arrays with elements P[0], P[1], P[2] and Q[0], Q[1], Q[2]. Elements of the arrays are to be read from the keyboard, let’s assume that they were: 25, 11 and 2. The arrays are to be initialised as following:
Q[0]=25 Q[1]=11 Q[2]= 2
P[0]=25 P[1]=11 P[2]= 2
the best approach is to write a small program implementing only task 2a as described above, and once you are happy
that it works correctly, add code to your program to perform task 2b, and so on.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps