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

  Enter the weight of a package

Write a program that asks the user to enter the weight of a package and then displays the shipping charges.

  Explain ethics of developing of system

To help counter terrorism, many countries are planning and development of computer systems that track large number of citizens and their actions. Clearly this has privacy, implications. Discuss the ethics of developing this type of system.

  Contemporary internal information system

You should complete the following tasks for the given business scenario. You are one of a team of newly graduated software engineers working on a project to build the infrastructure of an organization with an intensive and data sensitive internal ..

  Persuade your team to give time to organization

Discuss whether you should accept this demand from your manager or whether you should persuade your team to give their time to the organization rather than to their families.

  Devise a program and add more shapes

The program lets you choose one of three shapes (square, triangle, or cross) of a sub-area. Analyze consequences of the choice. If you have advanced programming knowledge, you may devise a program and add more shapes.

  Determine the thrust produced by this turbojet engine

Determine the total exergy destruction associated with the Otto cycle described in Problem 9-33, assuming a source temperature of 2000 K and a sink temperature of 300 K. Also, determine the energy at the end of the power stroke.

  Describe how the system was compromised

Describe the system, describe what you view the weakest link of the system to be and why, and describe how the system was compromised.

  Defined contribution pension plans gaining

Respond to the following question in this week's discussion board: The Response to the questions must be a least 500 work each question

  Determining the role of societal values

Elaborate in detail the role of societal values and social myths utilizing examples as well as importance of critical thinking. Provide references in APA format.

  Find the minimum element in an array of numbers

Consider the following algorithm to find the minimum element in an array of numbers A[0,...,n]. One extra variable tmp is allocated to hold the current minimum value. Start from A[0]; "tmp" is compared against A[1], A[2], . . . , A[N] in order. Wh..

  Sort the array and write out the sorted array

Consider a program that will read employee information into an array of objects, sort the array by employee identification number, write out the sorted array, and compute various statistics on the data, such as the average age of an employee.

  Implement a method

A supermarket wants to reward its best customer of each day, showing the customer's name on a screen in the supermarket. For that purpose, the customer's purchase amount is stored in an ArrayList and the customer's name is stored in a corresponding A..

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