Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i have done the evreything correct,but the compute series method doesnt give me correct answers , when i want to compute the series of 5
i have done the evreything correct,but the compute series method doesnt give me correct answers when i want to compute the series of the result is : while the corect anwer is : here is my MIPS code segment for the subroutine # # # # # # # # # # # # # # # #
computeSeries:
# print
la $a series
li $v
syscall
# read float end series
li $v # read end series $f
syscall
# print line
la $a series
li $v
syscall
#mov.s $f$f # $f contain the end of the series
# print the end series
# mov.s $f$f
#li $v
#syscall
# load elemnts
ls $fnum # $f
ls $fnum # n$f Counter i will div
ls $fCounter # $f counter base
ls $fSum # $fsum
loop:
ceqs $f$f # if counter end series stop loop
bct done
div.s $f$f$f # $fcompute n
add.s $f$f$f # add the n to the sum $f
add.s $f$f$f # increment n
add.s $f$f$f # increment counter
j loop
done:
# print
la $a sumResult
li $v
syscall
# print the sum here
mov.s $f$f
li $v
syscall
j main # go back to main menu
I need help to find out where is the wrong thing here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started