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