Write a marie program to calculate fib

Assignment Help Basic Computer Science
Reference no: EM131484578

Question: Task: 1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the two preceding ones: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 114, etc.

By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two. We define Fib(0)=0, Fib(1)=1, Fib(2)=1, Fib(3)=2, Fib(4)=3, etc. The first 22 Fibonacci numbers given below:

Fib (0)

Fib (1)

Fib (2)

Fib (3)

Fib (4)

Fib (5)

Fib (6)

Fib (7)

Fib (8)

Fib (9)

Fib (10)

0

1

1

2

3

5

8

13

21

34

55

Fib (11)

Fib (12)

Fib (13)

Fib (14)

Fib (15)

Fib (16)

Fib (17)

Fib (18)

Fib (19)

Fib (20)

Fib (21)

89

144

233

377

610

987

1597

2584

4181

6765

10946

Write a MARIE program to calculate Fib(n), where the user inputs n. For example, if the user inputs 7, the program outputs the value 13; if the user inputs 15, the program outputs the value 610; if the user inputs 20, the program outputs the value 6765 etc. You need to write and run the program using MARIE simulator. Please include appropriate comments to make your code readable.[10 marks]

(b) For some values of n, your program will not produce correct results. You can check this by gradually increasing the values of n and checking for the correct outputs. What is the maximum value of n for which your program produces a correct result? Why? Please comment on this [5 marks].

2. You are designing an instruction set for your computer. All the instructions are of same size (11 bits long). The size of an address field is 4 bits. You have already designed 5 2-address instructions and 45 1-address instructions. How many 0-address instructions still you can fit? Justify your answer. [7 marks]

3. Write codes to implement the expression: A= (B + C * D - E) on 3-, 2-, 1- and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands. [8 marks]
Rationale

This assessment task covers topics on CPU operation and Instruction Set Architecture, and has been designed to ensure that you are engaging with the subject content on a regular basis. More specifically it seeks to assess your ability to:

• be able to investigate the internal operation of the Central Processing Unit (CPU) and describe how it is used to execute instructions;

• be able to investigate and describe in detail the essential elements of computer organisation including internal bus, memory, Input/Output ( I/O) organisations and interfacing standards and discuss how these elements function;


Presentation: 1. Please compose the answers in a document file (doc or docx format). Please do not submit in pdf formats. Please upload the document in the Turnitin within deadline.

2. The first page (cover page) of the document file should have the following information clearly mentioned:

a. Your full name

b. Your Student ID

c. Subject Code (ITC544)

d. Assessment item number and name (Assignment 2: MARIE & ISA)

3. Each page should have page numbers in "page x of y" format (including the cover page).

4. You DO NOT need to provide any references for any of the questions.

Reference no: EM131484578

Questions Cloud

Define the bioethical principles commonly : Define the bioethical principles commonly utilized in healthcare and use these to argue for or against Louise's actions - What are the legal issues in case?
Nations market corporation most productive employee : Marcus is Nations Market Corporation’s (NMC) most productive employee. He is dissatisfied with NMC’s commission structure,
Define the type of the property : CQ Real Estate (CQRE) has requested you to create a Swing based Java GUI application to cater their needs. Whenever CQRE receives a propertysale offer.
Speech about a new product launch : You are supposed to give a speech to your top management team or all employees depending on the subject.
Write a marie program to calculate fib : Task: 1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact.
How much time will be allocated to each step or task : How much time will be allocated to each step or task? What voting mechanism is most appropriate for the size of the group and the specific stage of the process?
Consider the root causes of illicit drug use : There have been many legislative attempts at controlling the use of illicit drugs (whether prescription-type or otherwise).
Process leading to modern humans : A false impression about human evolution is that our evolution from a great ape ancestor is a linear process leading to modern humans
Describe a time when power is used unithically : Describe a time when power is used unithically and a time when power is used ethically.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd