The Essentials of Computer Organization and Architecture

Added on - 31 May 2021

  • 7

    Pages

  • 769

    Words

  • 8

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 3 of 7 pages
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 16thFibonacci number is counted as,3
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document