Ask a question from expert

Ask now

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
The Essentials of Computer Organization and Architecture_1
Table of ContentsQuestion 1...................................................................................................................................................3Question 2...................................................................................................................................................5Question 3...................................................................................................................................................5References...................................................................................................................................................72
The Essentials of Computer Organization and Architecture_2
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
The Essentials of Computer Organization and Architecture_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 ISA
|9
|529
|59

Computer Organization and Architecture - Assignment
|10
|718
|42

Assignment : Computer Organisation and Architecture
|12
|495
|20

Assembly Language Marie Programming
|12
|574
|96

Calculation of the Fib (n) with MARIE
|9
|583
|341

MARIE and ISA: Answers to Questions 1-3
|9
|811
|325