Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help on this question for Computer Organization and Assembly Language. I

ID: 639653 • Letter: I

Question

I need help on this question for Computer Organization and Assembly Language. I won't blindly copy the solution but will study it to help me understand topics of this course better. Any help would be much appreciated.

The framework is below. It is a .asm file. We need to implement an efficient solution to problem 150 of the Project Euler series (https://projecteuler.net/problem=150).

Thanks.

"

#Submitted by: Student Name *Fill this section with your name*


#------BEGIN--------
#---Uncomment for running the actual problem (Euler 150)---
#.include "euler150_test.asm"
#--------------------------------------------------


.data

#Uncomment ONLY ONE testcase (test and sol) at a time.
#--------------------TEST CASE SUITE---------------------begin
#TEST-1
test: .word 4, 0, -3, -4, 1, 7, 2, 3, 5, 6, 7
sol: .word -7

#TEST-2
#test: .word 10, 273519, -153582, 450905, 5108, 288723, -97242, 394845, -488152, 83831, 341882, 301473, 466844, -200869, 366094, -237787, 180048, -408705, 439266, 88809, 499780, -104477, 451830, 381165, -313736, -409465, -17078, -113359, 13804, 455019, -388898, 359349, -355680, 89743, 127922, 30841, 229524, -480269, -345658, 163709, -166968, 310679, 194330, 70849, -516036, -411781, -491602, 523333, 293360, -262753, -235646, -181751, -477980, 275459, 459414, 332301
#sol: .word -1495491

#TEST-3
#test: .word 7, 273519, -153582, 450905, 5108, 288723, -97242, 394845, -488152, 83831, 341882, 301473, 466844, -200869, 366094, -237787, 180048, -408705, 439266, 88809, 499780, -104477, 451830, 381165, -313736, -409465, -17078, -113359, 13804
#sol: .word -488152

#TEST-4
#------Test case for the example given in www.ProjectEuler.net 150
#test: .word 6, 15, -14, -7, 20, -13, -5, -3, 8, 23, -26, 1, -4, -5, -18, 5, -16, 31, 2, 9, 28, 3
#sol: .word -42
#--------------------TEST CASE SUITE---------------------end


.text
#-------------Your code goes below this line-----------
# 1) The first word pointed by the 'test' variable is the depth of the triangle
# 2) The words following the 'depth' are the elements of the triangle
# 3) The array carries depth*(depth+1)*0.5 number of elements
# Please direct your questions to pmp30@pitt.edu or shs173@pitt.edu
# Good Luck!

#Save your final answer in the register $a0
#---------Do NOT modify anything below this line---------------
lw $s0, sol
beq $a0, $s0 pass
fail:
la $a0, fail_msg
li $v0, 4
syscall
j end
pass:
la $a0, pass_msg
li $v0, 4
syscall
end:

.data
pass_msg: .asciiz "PASS"
fail_msg: .asciiz "FAIL"
#-----END------

"

Explanation / Answer

i tried but i am not sure...hope it helps!!!!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote