Answered step by step
Verified Expert Solution
Link Copied!

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 5 the result is : 1.45 while the corect anwer is :1.283333 here is my MIPS code segment for the subroutine # # # # # # # # # # # # # # # #
computeSeries:
# print
la $a0, series
li $v0,4
syscall
# read float end series
li $v0,6 # read end series = $f0
syscall
# print line
la $a0, series
li $v0,4
syscall
#mov.s $f1,$f0 # $f1 contain the end of the series
# print the end series
# mov.s $f12,$f0
#li $v0,2
#syscall
# load elemnts
l.s $f1,num1 # $f1=1.0
l.s $f2,num2 # n=$f2=2.0 Counter i will div
l.s $f3,Counter # $f3= counter base
l.s $f4,Sum # $f4=sum
loop:
c.eq.s $f3,$f0 # if counter == end series stop loop
bc1t done
div.s $f5,$f1,$f2 # $f5=compute 1/n
add.s $f4,$f4,$f5 # add the 1/n to the sum $f4
add.s $f2,$f2,$f1 # increment n
add.s $f3,$f3,$f1 # increment counter
j loop
done:
# print
la $a0, sumResult
li $v0,4
syscall
# print the sum here
mov.s $f12,$f4
li $v0,2
syscall
j main # go back to main menu
. I need help to find out where is the wrong thing here
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

=+ (c) Show that $ is countable if and only if L2 is separable.

Answered: 1 week ago

Question

financial ratios analysis all types

Answered: 1 week ago