hi, i need help in this question please. I need it in MARS please, again i need it in MARS .thank you.
Description
Unformatted Attachment Preview
Project 1: MIPS programming with MARS
In this project, you will write a MIPS assembly program and verify that it runs correctly with the
simulator MARS. This program consists of the following parts:
A.
Number array A[]: generate an array A[] of 35 positive and negative numbers (A[0]
to A[34]) from a given initial number x, and store A[] in M[0x2000, 0x2004, 0x2008,
.
B.
Parity array P[]: compute the parity p(A[i]) of each number in array A[] and store
the parity array P[] in M[0x2100, 0x2104, 0x2108, n
C.
Col sum array S[]: view the parity array P[] as a 7 by 5 matrix, stored by rows,
compute the sum of each column, and store the sum values of the 5 columns in an
array S[] in M[0x2200, 0x2204, 0x2208, 0x220C, 0x2210].
D.
(extra credit) Generate a large array L[] from x with 120 numbers, store in memory,
treat it as a 10 by 12 matrix, and store its transpose in memory.
This program will be used for the subsequent projects of this class.
MARS Setup:
IPS Memory Configuration should be set to the 3rd
option: Compact, Text at Address 0
Input / Output specs:
our program must begin with the following line to set A[0] to a given value x (such
as A[0] = 1). This way, it, be easy for us to test your program for any values
addi $7, $0, 1
our program should produce the resulting arrays in the following memory locations:
A):
A[0] – A[34]:
at M[0x2000, 0x2004, JB):
P[0] [34]:
at M[0x2100, 0x2104, JC):
S[0] [4]:
at M[0x2200, 0x2204, JD):
L[0] – L[119]:
at M[0x3000, 0x3004, JT[0] – T[119]:
at M[0x3200, 0x3204, JPart (A) umber Array A[]:
Starting with setting number x in $7 by ddi $7, $0, x your program should generate
an array A[] of 35 numbers the following way:
A[0] = x
stored at M[0x2000]
A[1] = -(x+1)
stored at M[0x2004]
A[2] = (x+2)
stored at M[0x2008]
A[3] = -(x+3)
stored at M[0x200C]
A[4] = (x+4)
stored at M[0x2010]
or example, if x=1, then the array A[] will be
1, -2, 3, -4, -34, 35.
Part (B) arity Array P[]:
Find the parity p(A[i]) of each number in array A[], to form a new array P[], and store it
at M[0x2100, 2104, n
o
Definition of parity p(x):
?
if the number of 1 in the 32-bit binary representation of x is odd, then
p(x) = 1
o For example, p(-2) = 1, because the count of 1 in 32-bit rep of -2
(1111 1111 1111 1111 1111 1111 1111 1110) is 31, which is an odd
number.
o For example, p(13) = 1, because the count of 1 in 32-bit rep of 13
(0000 0000 0000 0000 0000 0000 0000 1101) is 3, which is an odd
number.
?
if the number of 1 in the 32-bit binary representation of x is even, then
p(x) = 0
o For example, p(3) = 0, because the count of 1 in 32-bit rep of 3 (0000
0000 0000 0000 0000 0000 0000 0011) is 2, which is an even number.
o For example, p(-4) = 0, because the count of 1 in 32-bit rep of -4
(1111 1111 1111 1111 1111 1111 1111 1100) is 30, which is an even
number.
If x=1, then the array P[] would be:
1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0,
1, 1, 0, 0, 1
Part (C) ol sum S[] for P[] as a matrix :
The parity array P[] is viewed as a 7 by 5 matrix stored by rows (example with x=1):
1
1
0
0
0
0
1
1
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
0
0
1
1
0
0
1
Your program should compute the sum of each column, and store it in a new array S[]
starting from M[0x2200]:
5
Part (D)
o
o
5
2
2
3
(extra credit) Transpose T[] of a large matrix L[]:
Generate a large array L[] from the same initial x in $7 with 120 numbers,
the same way array A[] is formed, store it in M[0x3000, 0x3004, JTreat L[] as a 10 by 12 matrix, and store its transpose as array T[], to
store into M[0x3200, 0x3204, n
Levels of completion and scores:
1) (60%)
Your code should achieve (A)
2) (80%)
Your code should achieve (A) + (B)
3) (100%)
Your code should achieve (A) + (B) + (C)
4) (10% extra credit) for achieving (D).
Technical Report components:
1. (10 pts) General introduction
a) Which parts (A – D) does your program achieve?
b) What was the most difficult part of this project?
c) How many hours have you spend in total on this project?
d) If you worked in a group of more than 1 person, provide a rough breakdown
of each memberàcontribution.
2. (80 pts) Program functionality
Run your program for the following 2 configurations:
i. x = 1
ii. x = -23
Provide MARS screenshot results for each of the above configurations,
including:
inal results of all the arrays – show MARS$ata memory content at
regions such as: 0x2000, 0x2100, etc. Mark out the results clearly.
ynamic Instruction count of completing your program (use MARS Tools > Instruction Statistics).
3. (10 pts) Assembly code – clearly marked the parts for A, B, C, etc.
What to submit: upload the following two files on Bb
report.pdf
the technical report specified above.
p1.asm
your MIPS assembly code (so that we can run your code on
MARS -issing it will result in -5 points).
Deadline:
week 5 Sunday (end of the day) on Bb.
Late submission policy and penalty:
submission by the end of
late penalty on your total score
Sun – due date
0%
Mon
5%
Tue
10%
Wed
15%
Thu
20%
Purchase answer to see full
attachment
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."