Write an arm assembly code to implement a loop for factorial

Assignment Help Basic Computer Science
Reference no: EM13999555

Project 2:

Part-1:

Write an ARM assembly code to implement a loop for calculating factorial of an integer N. For example if the input N from the standard input is equal to 5, it should return 120 (i.e, 5! ); the result (i.e, 120) should be printed on the standard output.

Part-2:

1. Repeat part-1 for N factorial, by adding code to measure program execution time in
milliseconds. This can be achieved by reading system time and storing it into a General Purpose Register (GPR), or preferably in memory location, and before the program exits read system time again the difference is the time elapsed for execution. Write the elapsed time in the output file on the same line as the factorial number in tabular form. Example:
Number ---------- 5
Factorial ----------- 120
Time elapsed (ms) ---------------------- 351

Once you have your program working and creating the proper out file as shown in the example above, move to next step.

2. Repeat step 1 using by having the following numbers in your input file to calculate their factorial and the output file must have one entry for each number as shown in the example table in previous step. The numbers to use in your input file are:
5, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

Note: add appropriate comments to your assembly code explaining what each instruction does in the context of your program.

Reference no: EM13999555

Questions Cloud

Calculate the rotational kinetic energy : Calculate the rotational kinetic energy, and the magnitude of the angular momentum of the disc. The centre-of-mass rotational inertia of a disc is Icm - mr2/2.
What is the mass of the airplane : An 1800-kg tractor exerts a force of 1.75 x 10^4 N backward on the pavement, and the system experiences forces resisting motion that total 2400 N. If the acceleration is 0.150 m/s2, what is the mass of the airplane?
What force would you have to exert perpendicular to center : Suppose your car was mired deeply in the mud and you wanted to use the method illustrated in Figure 4.29 to pull it out. (a) What force would you have to exert perpendicular to the center of the rope to produce a force of 12,000 N on the car if th..
How much energy is required to assemble given three charges : What is the magnitude and direction of the net electrostatic force on charge q1? How much energy is required to assemble these three charges?
Write an arm assembly code to implement a loop for factorial : Write an ARM assembly code to implement a loop for calculating factorial of an integer N. For example if the input N from the standard input is equal to 5, it should return 120 (i.e, 5! ); the result (i.e, 120) should be printed on the standard ou..
How much does the upper arm bone shorten in length : During a wrestling match, a 150 kg wrestler briefly stands on one hand during a maneuver designed to perplex his already moribund adversary. By how much does the upper arm bone shorten in length? The bone can be represented by a uniform rod 38.0 ..
Create a single record form using the employees table : The file will be renamed automatically to include your name. Change the project file name if directed to do so by your instructor. If necessary, enable active content again. Create a Single Record form using the Employees table as the record source
Calculate the magnetic field in the solenoid : An air-filled toroidal solenoid has 390 turns of wire, a mean radius of 15.0 cm , and a cross-sectional area of 5.00 cm2 . If the current is 5.40 A , calculate the magnetic field in the solenoid.
Find the tension in the rope and the steel beam : A mass of 120 kg is suspended on a rope and a steel beam as shown on the diagram below. d1 = 2 m, d2 = 4m, and d3 = 5m. Draw a diagram that shows all the forces involved in this problem. Find the tension in the rope and the steel beam.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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