tag:blogger.com,1999:blog-8264121216529648346.post3147221389428028592..comments2023-06-19T18:58:27.081+03:00Comments on Another Computers Blog: MIPS Recursive FibonacciAndreas Papadopouloshttp://www.blogger.com/profile/00161799984377327238noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-8264121216529648346.post-67340565384525997412015-02-03T16:32:54.294+02:002015-02-03T16:32:54.294+02:00thank you bro !thank you bro !Anonymoushttps://www.blogger.com/profile/16268996720461738914noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-30468779524876477552013-06-23T02:43:41.157+03:002013-06-23T02:43:41.157+03:00Hi, can you explain me briefly whats is going on i...Hi, can you explain me briefly whats is going on in this code? I understand that the program write on the SP all the iterations, like if you put 7, will be 6 x3 in the stack, but what happen later? (i'm really bad at this)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-56725038235329257022013-05-01T07:27:12.039+03:002013-05-01T07:27:12.039+03:00how do you get it to print every number? i tried l...how do you get it to print every number? i tried li $v0,4 and syscall on lines 49 and 50 and still no result help!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-78146019137751574042012-01-09T02:17:41.090+02:002012-01-09T02:17:41.090+02:00Thanks for the help!!Thanks for the help!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-25491346272901934402011-12-20T09:48:10.825+02:002011-12-20T09:48:10.825+02:00Hello,
Thank you for visiting.
Take a look at:
Fi...Hello,<br />Thank you for visiting.<br />Take a look at:<br /><br /><a href="http://akomaenablog.blogspot.com/2008/04/fibonacci-in-c.html" rel="nofollow">Fibonacci in C</a>Andreas Papadopouloshttps://www.blogger.com/profile/00161799984377327238noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-56720466903664844332011-12-19T21:08:49.815+02:002011-12-19T21:08:49.815+02:00thx a lot!
i wonder how would u translate this mi...thx a lot! <br />i wonder how would u translate this mips code in c++Nepali fanhttps://www.blogger.com/profile/17279501447203475831noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-90506350466409794122011-07-20T07:02:36.546+03:002011-07-20T07:02:36.546+03:00thank you!it helps me so much! it made me crazy!thank you!it helps me so much! it made me crazy!Unknownhttps://www.blogger.com/profile/05208860860353318274noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-88492638230646451032011-05-24T16:56:12.510+03:002011-05-24T16:56:12.510+03:00Hello again,
Line 57 (jr $ra) does not always jum...Hello again,<br /><br />Line 57 (jr $ra) does not always jump to line 44. It may jump to line 44,50 or 16. At the end of the call on line 42 the whole function ran and calculated fib(n-1). As you can see on line 50 $v0 is by fib(n-2). Your question is the same as why at line 50 $v0 has fib(n-2)? This the recursion process. When you go to line 44 the code below this line was executed in previous recursive calls.<br />Did you run the code step by step and notice how $v0 changes? You may perhaps try to run it on paper with a small y (e.g. 5).<br /><br />Thank you for visiting my blog.Andreas Papadopouloshttps://www.blogger.com/profile/00161799984377327238noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-86031516136942389612011-05-21T23:46:46.792+03:002011-05-21T23:46:46.792+03:00hey, its me again, hoping not to annoy you.
My pr...hey, its me again, hoping not to annoy you. <br />My problem is, that i dont understand, why in line 44 there is fib(n-1) in $v0. Would be nice, if you could explain me. I think that line 57: jr $ra causes the jump to line 44, right? (Because line 42 jumped and linkes line 44 in $ra) and this is only reached by the return1 label, which says: li $v0, 1. So there would be a 1 in $v0. But how is it possible that you have fib(n-1)?<br />Need to understand that for university, hope u can help me out and thanks for your last answer.<br />greetingsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-8433982195408175322011-05-19T09:59:59.947+03:002011-05-19T09:59:59.947+03:00Hello,
Thank you for visiting my blog and for your...Hello,<br />Thank you for visiting my blog and for your comment too!<br /><br />When you call fib on line 42 you want to get the fib(n-1). that is when it returns you have on $v0 the fib(n-1). if you add one you will loose the result. 1 is only the first time when recursion starts unrolling. After the first time you won't have 1 on $v0.<br /><br />That is when the program reaches line 44 you have successfully calculate fib(y-1) an then on line 48 you call again to calculate fib(y-2). So when you reach line 50 you have fib(y-1) on $s0 an fib(y-2) on $v0. Add them and return the result.<br /><br />I suggest you run step by step the code and you will notice that if you add 1 on line 44 you will get wrong results as $v0 is not always 1.<br /><br />I hope that this will help you.<br />Thank you very much.Andreas Papadopouloshttps://www.blogger.com/profile/00161799984377327238noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-18559165963891204122011-05-18T14:43:19.591+03:002011-05-18T14:43:19.591+03:00Hey,
thanks for ur programm, works nice. But i hav...Hey,<br />thanks for ur programm, works nice. But i have one problem to understand it, would be nice if u could help me out.<br /><br />in line 42 u jump to the fib-label and save the adress of line 44. it will go on with line 44, when the exitfib label is called from label return1. but return 1 writes a 1 in register v0. i wonder why then in line 44 u have fib(n-1) instead of 1(which was wrote in v0 by return1). i hope my english is understandable, would be nice to hear from u.<br />greetingsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-62584394977223332372010-11-27T11:15:12.274+02:002010-11-27T11:15:12.274+02:00Hello,
First of all thank you for visiting and rea...Hello,<br />First of all thank you for visiting and reading my blog.<br />The above program return the fib(n).<br />When you give n and you want to print all the numbers you have to change the function to print every number calculated in fib depending on what order you want to print.<br />For example you can add on line 45 to print $s1 which contains the fib (y-1). or you can print $v0 on line 49.<br />I didn't try it but I am pretty sure it will work.<br />Good luck and thank you.Andreas Papadopouloshttps://www.blogger.com/profile/00161799984377327238noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-44323871860043751822010-11-27T00:59:03.210+02:002010-11-27T00:59:03.210+02:00Is there a way to print all the numbers until '...Is there a way to print all the numbers until 'n' with this recursive solution?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-33221079354244597592010-11-18T21:43:24.372+02:002010-11-18T21:43:24.372+02:00thanks a lot bro (:thanks a lot bro (:Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-89031858620850261282010-10-11T20:55:02.676+03:002010-10-11T20:55:02.676+03:00thanx a lot... It helped me a lotthanx a lot... It helped me a lotAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-84785800160015050742010-05-11T14:32:08.340+03:002010-05-11T14:32:08.340+03:00Thank you very much for your code! i really enjoye...Thank you very much for your code! i really enjoyed testing it.Unknownhttps://www.blogger.com/profile/03194410274111105384noreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-91679648421679773612010-02-18T12:24:00.576+02:002010-02-18T12:24:00.576+02:00Hey this block of code is really cool.... helped ...Hey this block of code is really cool.... helped me a lot..... Thanks so much for uploading....!!!<br /><br />- TSAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-21233515841177742182009-10-16T12:37:55.028+03:002009-10-16T12:37:55.028+03:00very good thank you for your help!!!very good thank you for your help!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8264121216529648346.post-69278909473709301552009-07-01T20:04:48.440+03:002009-07-01T20:04:48.440+03:00Thanks very much :)Thanks very much :)Anonymousnoreply@blogger.com