8051 Program to find 10 fibonacci numbers and store it an array.

Program to find 10 fibonacci numbers and store it an array. 

In this article let’s learn how to find fibonacci numbers and store it in an array. Basically fibonacci number is a series where each term is the sum of previous two numbers.

Algorithm:

1)Store the memmory address in R0 and counter in R3.
2)Store first two numbers that is 0 and 1 in memory space.
3)Add the previous two numbers and store in an memory space.
4)Exchange the registers and store the previous two numbers.
5)Repeat the steps 2,3 and 4 till the counter value becomes zero.


Code goes here:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Advertisment ad adsense adlogger