programb49

programb49 - Microprocessors & Applications (UPTU)...

This preview shows pages 1–2. Sign up to view the full content.

Appendix B  Explanation : The Fibonacci series is 0 1 1 2 3 5 8 13 21…. The first two terms are 0 1, the third term is computed as 0 + 1 = 1, fourth term 1 + 1 = 2, fifth term = 1 + 2 = 3. i.e. n th term = (n – 2) th term + (n – 1) th term. We will find the series say for 10 terms i.e. N = 10. We will initialize count = 10. An array res is initialized, so that the computed terms will be stored in it. SI is initialized to start of res. The first term i.e. 0 is stored at start. SI is incremented and next term is stored i.e. 1. Then addition of contents of two locations i.e. 0 and 1 is done. The next term is computed and result is stored at third location. Process is repeated till all 10 terms are computed. Display the result. The result in Hex will be 0 1 1 2 3 5 8 0D 15 22.  Algorithm : Step I : Initialize the data section. Step II : Initialize the counter = 10 i.e. 0AH. Step III :

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/04/2011 for the course ECON 101 taught by Professor Lucky during the Spring '11 term at Silver Lake.

Page1 / 3

programb49 - Microprocessors & Applications (UPTU)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online