Write an assembly program that computes factorial

Assignment Help Programming Languages
Reference no: EM13698060

Question 1.

This assignment needs at computing the function (where n! is the factorial of n) for several n values.

Write an assembly program that computes f(1), f(2), f(3),..., and f(10). Note that n! is defined as follows: or . Also, note that 1! = 0! = 1.

Here are the requirements of your program:

- Use the minimum amount of instructions.

- Use the minimum amount of variables.

- Only instructions described in Chapter 4 of your textbook are allowed.

For example, no multiplication instructions are allowed.

- Use extensive comments to describe your program.

- You can use the Irvine32 library procedure DumpRegs to display the contents of the registers.

Produce an executable version of your program and make sure that it runs correctly.

HINT: To compute 5!, you can use the subsequent algorithm:

1. Compute 4!

2. Add 4! five times and you get: 4! + 4! + 4! + 4! + 4! = 5 x 4! = 5! 2.

The above program can be solved with approximately 20 instructions and no data variables. So, do not use excessive number of data variables or instructions.

Reference no: EM13698060

Questions Cloud

Algorithm to compute binomial coefficients : Analyze the time taken by this algorithm under the unreasonable assumption that the addition C(n-1, k-1) + C(n - 1, k) can be carried out in constant time once both C(n-1, k-1) and C(n - 1, k) have been obtained recursively.
Write a program in java that reads a file : Write a program in Java that reads a file of numbers of type int and outputs all the numbers to another file, but without there being any duplicate numbers.
Determine all letter and person that have value over 1000 : Determine all Letter and Person that have value over 1000. Use sub query - Show results sorted by letter in ascending order and person in descending.
Describe a fast algorithm for finding the integer : Describe a fast algorithm (with ~N array lookups of A) for finding the integer in A that is repeated. Can you give the algorithm ASAP?
Write an assembly program that computes factorial : Write an assembly program that computes f(1), f(2), f(3),..., and f(10). Note that n! is defined as follows: or . Also, note that 1! = 0! = 1.
Write a select statement that returns two columns : Write a SELECT statement that returns these two columns - CategoryName The CategoryName column from the Categories table
Write a select statement that returns the productname : Write a SELECT statement that returns the ProductName and ListPrice columns from the Products table.
Prepare a sql statement to use joining the tables : Write a SELECT statement that joins the Customers, Orders, OrderItems, and Products tables.
Write a select statement that joins the customers table : Write a SELECT statement that joins the Customers table to the Addresses table and returns these columns: FirstName, LastName, Line1, City, State, ZipCode.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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