What is maximum value of n for which your program produces

Assignment Help Computer Engineering
Reference no: EM131975006

Assignment

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.

(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.

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 six 2-address instructions and 30 1-address instructions. How many 0-address instructions still you can fit? Justify your answer.

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.

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;

Reference no: EM131975006

Questions Cloud

What is the probability that the price is between : If you randomly pick a gas station, what is the probability that the price is between $2.30 and $2.60 per gallon?
What is the range of fixed rates for b : Firm A can borrow at 4% fixed or at Libor flat in the fixed and floating rate markets, respectively. Firm B can borrow at 7% fixed or Libor plus 100 bps.
Daily number of customers at the yumyum : 1. Suppose you roll a six-sided die 7 times and count the number of fives. What is the probability you get exactly two fives?
How large will your last payment be : Six years from today you need $10,000. How large will your last payment be?
What is maximum value of n for which your program produces : For some values of n, your program will not produce correct results. What is the maximum value of n for which your program produces a correct result? Why?
Compute the project profitability index : A firm with a 10 percent cost of capital is considering a project for this year's capital budget. The project's expected after tax cash flows are as follows.
Relationship between the attractiveness scores : A social scientist wishes to determine whether there is a relationship between the attractiveness scores (on a 100-point scale) assigned to college students.
Account immediately after you make the first withdrawal : How much will be in the account immediately after you make the first withdrawal?
What is the total force due to solar radiation pressure : What is the total force due to solar radiation pressure on an object on surface of the earth? Compare this force to gravitation force on the object

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define derived classes professional and non-professional

A company has two different kinds of employees: professional and nonprofessional. Define derived classes Professional and Non_Professional.

  Discuss what is the data mining

Online Discussion forum: Post your proposed topic and chosen dataset as well as a short plan for the project. Explain if it falls into the supervised.

  Describe three role required to provide and use web services

Explain the ultimate goal of Web services. Describe the three roles required to provide and use Web services. What is UDDI? What is SOAP?

  Identify modules from cpan that can support a gui

Identify modules from CPAN that can support a graphical user interface (GUI), network protocol, and database adapters.

  Design a class for services offered by a hair-styling salon

The Curl Up and Dye Salon offers a variety of salon services for its customers. Jane Fields, owner, has contracted to have you write a program that allows reports to be output, sorted by each kind of service offered. Table below shows the various ..

  What is the difference between a frame and a panel

What is the difference between a frame and a panel? What is most important difference between user interface of console application and a graphical application?

  Questionwrite down a java program that uses a

questionwrite down a java program that uses a two-dimensional array to store the highest and lowest temperatures for

  Write a program to calculate and display a persons body bmi

Write a program to calculate and display a person's Body Mass Index (BMI). BMI is an internationally used measure of obesity.

  Write the structural vhdl code to implement device

Two voltage and two current sensors indicate measured voltage with 16-bit binary values on their output lines, S15 to S0.

  Create a windows form mock-up for the given requirements

Create a Windows form mock-up for the following requirements document and Use Case Definition. The Windows Form object and the other objects in the user interface are shown in Figure 2-82

  Create a workflow diagram to illustrate how analytics and

large companies have been using the power of business analytics for quite a while now. your company desires to get in

  Discovering the apriori algorithm with a small dataset

Find all the frequent itemsets. You should illustrate the process of finding these frequent itemsets (refer to slide 24 in the lecture notes).

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