The Essentials of Computer Organization and Architecture
7 Pages769 Words65 Views
Added on 2021-05-31
The Essentials of Computer Organization and Architecture
Added on 2021-05-31
BookmarkShareRelated Documents
Title Page1
Table of ContentsQuestion 1...................................................................................................................................................3Question 2...................................................................................................................................................5Question 3...................................................................................................................................................5References...................................................................................................................................................72
Question 1a.The MARIE code for counting the Nth Fibonacci number is, ORG 100CLEAR//clears the accumulator.INPUT// User input for the Nth Fibonacci number.SUBT ONE// As Fibonacci series starts from 0th number, so that is adjusted.STORE CTRLOOP1, CLEAR//loop for counting the Fibonacci number.LOAD CTRSUBT ONE//updates the counter.STORE CTRLOAD S2STORE S3LOAD S2ADD S1STORE S2LOAD S3STORE S1//updates S1 and S2. The adjacent Fibonacci numbers on each iteration of the loop.LOAD CTRSKIPCOND 400//The loop runs until the counter becomes 0.JUMP LOOP1LOAD S2OUTPUT//Prints the final output.HALTONE, DEC 1CTR, DEC 0S2, DEC 1S1, DEC 0S3, DEC 0The output, The 16th Fibonacci number is counted as, 3
End of preview
Want to access all the pages? Upload your documents or become a member.
Related Documents
Computer Organization and Architecture Assignment 2: MARIE and ISAlg...
|9
|529
|59
Computer Organization and Architecture - Assignmentlg...
|10
|718
|42
Assignment : Computer Organisation and Architecturelg...