Write codes to implement the given expression

Assignment Help Computer Engineering
Reference no: EM132128464

COA Assignment Task -

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

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

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

Reference no: EM132128464

Questions Cloud

Find out how many times a customer generated an invoice : Find out how many times a customer generated an invoice - make sure the counted column heading reads "Invoices_generated"
Definitely could have engaged in strategic planning : Describe a period where the organization definitely could have engaged in strategic planning
Parent company consisting of multiple chains : Most of the entities below are classified by STR as “Chains”. Which one is a “Parent Company” consisting of multiple chains?
How you would test for a causal effect : Explain why the following claims might not imply causal relationships and outline how you would test for a causal effect using an experimental methodology.
Write codes to implement the given expression : COA Assignment Task - Write codes to implement the expression: A= (B + C * D - E) on 3-, 2-, 1- and 0-address machines
Calculate the mean hourly wage for men and women : Calculate the mean hourly wage for men and women in this sample. What is the difference in mean wages? Is this evidence of discrimination? Why or why not?
Develop a business proposal persuading the senior management : Develop a business proposal persuading the senior management of your organization to initiate a change in processes, procedures.
Estimating a model of stock prices : When using OLS, we assume that the errors are independent (i.e., not serially correlated) and normally distributed with constant variance (i.e., homoscedastic).
Explain how the use of activity-based costing system : Explain how the use of an activity-based costing system could change the results of the budget, if utilized.

Reviews

Write a Review

Computer Engineering Questions & Answers

  When should multinational business consolidate data systems

When should a multinational/multisite business consolidate data systems? What justification should Conor use to push for a consolidated, unified ERP system? 3. At times, Conor has to deal with incomplete and incompatible data.

  Explain the properties of the gray codes

Which rows and which columns of a 4 × 16 map for Boolean functions in six variables using the Gray codes 1111, 1110, 1010, 1011, 1001, 1000, 0000, 0001, 0011.

  Write a service package called my-math-library

Write a service package (declaration and body) called My_Math_Library that contains a single function called Sqrt that returns the square root of a Float value.

  Compare monoalphabetic and polyalphabetic ciphers

Differentiate: Block ciphers from stream ciphers and contrast symmetric from asymmetric cryptography. Illustrate with examples (Max Half a page)

  How many ram chips are there per memory word

How many RAM chips are necessary? How many RAM chips are there per memory word? How many address bits are needed for each RAM chip? How many banks will this memory have? How many address bits are needed for all of memory?

  How the given policy solutions should be incorporated

Create a brief description of how these policy solutions should be incorporated into the given framework. The description should thoroughly analyze.

  Define design and consultancy services

A description of proposed virtual infrastructure for the data centre including which virtual technology is recommended and the reasons for that recommendation.

  Briefly define e business and e commerce

Briefly define e-business and e-commerce. How are they related?- Explain the relationship between the periodic mode and batch processing.

  Wap that can perform a caesar cipher

Using the Web or other resources, write a brief paper about RSA, its history, methodology, and where it is used. Students with a sufficient math background.

  Define authentic as a result of the user authentication

Explain to what degree the service provider can assume that the data received during the session are authentic as a result of the user authentication

  A description of the design of your solution

In this project, you are asked to solve the readers and writers problem by using the clientserver model and a kind of communication facility.

  Assume that you are working on a project to develop an

suppose you are working on a project to develop an enterprise resource planning erp interface for the operations

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