Question: Part1A: write a ARM program that computes terms of the Fibonacci series, starting with 0, is defined as: 1, 1, 2, 3, 5, 8, 13,
Part1A:
write a ARM program that computes terms of the Fibonacci series, starting with 0, is defined as:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...
Each term in the series is the sum of the preceding two terms. So, for example, the 7th term (13) is the sum of the 5th and 6th terms (5+ 8).
Write the program as a counting loop for terms 3 and on. You should test your output for the 11th terms of the series. You are not saving all of the terms, only the last TWO which are then used to compute the next term. Use a register for the current term and a register for the previous term. Each execution of the loop computes a new current term (in a third register) and then copies the old current term to the previous term register and the new term to the current term register. You will also need a fourth register for your loop counter.
Part1B:
Modify your code (separate from Part1A) so that it STORES the first 25 Fibonacci numbers that are generated into sequential memory locations. Use a label and .skip directive to setup 25 memory words all initialized to 0, then store the Fib sequence in those locations. Name the block fibs and use the p command of gdb to show the values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
