Sec!on Merge: CMPEN 331: Computer Organiza!on an… Assignments HW 0: Ini!al assignment in MIPS assembly and Python!
HW 0: Ini!al assignment in MIPS
assembly and Python
Due Friday by 23:59 Points 20 Submi!ng a file upload
File types zip Available un!l 24 Sep at 23:59
Start Assignment
This assignment has two parts:
Part A:
Wri”ng a func”on that produces the NxN matrix resul”ng from adding an N-
element vector to the diagonal of an NxN matrix, in MIPS assembly.
You will use MARS for this por!on of the assignment. A simple calling framework,
with one hardcoded test case, is provided in “Diagonal-tester.asm” — treat this as
your “main” file and load it first in MARS. Your solu!on MUST be specified in the
provided file “DiagAdd.asm” and use the provided global label “DiagAdd” for your
func!on name (i.e. you cannot change the name of the func!on). Documenta!on
of each argument is to the func!on is available within DiagAdd.asm. When
execu!ng the program, the test wrapper will print out the number of erroneous
entries in the NxN result matrix. It should be 0 for a correct solu!on.
You will only be turning in your modified copy of DiagAdd.asm. Feel free to modify
Diagonal-tester.asm to test addi!onal inputs. We will be tes!ng your code with
different values of N and different input matrices/vectors.
Part B:
Modeling selected proper”es of low-level logic (the carry chain values in a ripple
carry adder) in Python.
You may use the Python3 environment of your choice to do this assignment. You
are provided with two files: “rippleAdderMain.py” and “rippleAdder.py”.
RippleAdderMain runs three inputs through the “adder” func!on defined in
rippleAdder.py and checks them for correctness. You will implement the “adder”
func!on in rippleAdder.py that is currently a stub placeholder. The adder func!on
takes three arguments, the first an integer N >=1 and the la#er two a pair of bit
strings. The outputs of this func!on relate to the opera!on of an n-bit ripple carry
adder. Specifically, they are the carry out, n-bit sum, and set of all carries that
would be generated in a ripple carry addi!on of the lowest n bits of each bit-string
argument. More details and examples are present in the comments in
rippleAdder.py and via the three test cases in RippleAdderMain.py. You will only be
turning in your modified copy of rippleAdder.py. We will be tes!ng your code with
inputs beyond those in the provided test wrapper. Feel free to add addi!onal cases
to your local copy of the test wrapper or otherwise modify the exis!ng test cases.
A zip file with the framework code will be provided in Modules. Please turn in a zip file
containing only the two modified files DiagAdd.asm and rippleAdder.py
If you experience challenges in extrac!ng or running the framework code, MARS in
general, or other technical challenges not related to the content of the solu!ons of this
assignment, please check Piazza and post queries there first before e-mailing TAs or
instructors — logis!cal challenges o$en have common solu!ons, and answering each in
isola!on is less efficient.
“Previous Next#
2218 – 202122FA
Home
Syllabus
Piazza
Assignments
Quizzes
Zoom
Grades
Modules
Account
Dashboard
Courses
Groups
Calendar
Inbox
History
My Media
No!ces
Help
https://psu.instructure.com/courses/2136715
https://psu.instructure.com/courses/2136715/assignments/syllabus
https://psu.instructure.com/courses/2136715/external_tools/195053
https://psu.instructure.com/courses/2136715/assignments
https://psu.instructure.com/courses/2136715/quizzes
https://psu.instructure.com/courses/2136715/external_tools/207840
https://psu.instructure.com/courses/2136715/grades
https://psu.instructure.com/courses/2136715/modules
https://psu.instructure.com/