1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Blizzard [7]
4 years ago
13

Write a new ARMv8 assembly file called "lab04b.S" which is called by your main function. It should have the following specificat

ions: Create a function that computes factorials: n! = n · (n − 1) · ... · 3 · 2 · 1. Use the my_mul function in question 1 for all multiplications Use the concept of recursion. Do NOT directly use the concept of iteration. Do not forget that using the recursion is the same as using the STACK. Make sure you comment on the code. Demonstrate your code running to the TA. Turn in your lab04b.S file here when complete.
Engineering
1 answer:
Len [333]4 years ago
6 0

Answer:

my_mul:

.globl my_mul

my_mul:

   //Multiply X0 and X1

   //   Does not handle negative X1!

   //   Note : This is an in efficient way to multipy!

   SUB SP, SP, 16       //make room for X19 on the stack

   STUR X19, [SP, 0]    //push X19

   ADD X19, X1, XZR     //set X19 equal to X1

   ADD X9 , XZR , XZR //set X9 to 0

mult_loop:

   CBZ X19, mult_eol

   ADD X9, X9, X0

   SUB X19, X19, 1

   B mult_loop

mult_eol:

   LDUR X19, [SP, 0]

   ADD X0, X9, XZR      // Move X9 to X0 to return

   ADD SP, SP, 16       // reset the stack

   BR X30

Explanation:

You might be interested in
The dry unit weight of a soil sample is 14.8 kN/m3.
Jlenok [28]

Answer:

See attachment for completed question

Explanation:

Given that; Brainly.com

What is your question?

mkasblog

College Engineering 5+3 pts

The dry unit weight of a soil sample is 14.8 kN/m3.

Given that G_s = 2.72 and w = 17%, determine:

(a) Void ratio

(b) Moist unit weight

(c) Degree of saturation

(d) Unit weight when the sample is fully saturated

See complete solving at attachment

4 0
4 years ago
In this assignment, you will write a user interface for your calculator using JavaFX. Your graphical user interface (GUI) should
Zolol [24]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import javafx.application.Application;

import javafx.stage.Stage;

import javafx.scene.Group;

import javafx.scene.Scene;

import javafx.scene.layout.VBox;

import javafx.scene.layout.HBox;

import javafx.scene.control.TextField;

import javafx.scene.control.Button;

public class Calculator extends Application {

public static void main(String[] args) {

// TODO Auto-generated method stub

launch(args);

}

"at"Override

public void start(Stage primaryStage) throws Exception {

// TODO Auto-generated method stub

Group root = new Group();

VBox mainBox = new VBox();

HBox inpBox = new HBox();

TextField txtInput = new TextField ();

txtInput.setEditable(false);

txtInput.setStyle("-fx-font: 20 mono-spaced;");

txtInput.setText("0.0");

txtInput.setMinHeight(20);

txtInput.setMinWidth(200);

inpBox.getChildren().add(txtInput);

Scene scene = new Scene(root, 200, 294);

mainBox.getChildren().add(inpBox);

HBox rowOne = new HBox();

Button btn7 = new Button("7");

btn7.setMinWidth(50);

btn7.setMinHeight(50);

Button btn8 = new Button("8");

btn8.setMinWidth(50);

btn8.setMinHeight(50);

Button btn9 = new Button("9");

btn9.setMinWidth(50);

btn9.setMinHeight(50);

Button btnDiv = new Button("/");

btnDiv.setMinWidth(50);

btnDiv.setMinHeight(50);

rowOne.getChildren().addAll(btn7,btn8,btn9,btnDiv);

mainBox.getChildren().add(rowOne);

HBox rowTwo = new HBox();

Button btn4 = new Button("4");

btn4.setMinWidth(50);

btn4.setMinHeight(50);

Button btn5 = new Button("5");

btn5.setMinWidth(50);

btn5.setMinHeight(50);

Button btn6 = new Button("6");

btn6.setMinWidth(50);

btn6.setMinHeight(50);

Button btnMul = new Button("*");

btnMul.setMinWidth(50);

btnMul.setMinHeight(50);

rowTwo.getChildren().addAll(btn4,btn5,btn6,btnMul);

mainBox.getChildren().add(rowTwo);

HBox rowThree = new HBox();

Button btn1 = new Button("1");

btn1.setMinWidth(50);

btn1.setMinHeight(50);

Button btn2 = new Button("2");

btn2.setMinWidth(50);

btn2.setMinHeight(50);

Button btn3 = new Button("3");

btn3.setMinWidth(50);

btn3.setMinHeight(50);

Button btnSub = new Button("-");

btnSub.setMinWidth(50);

btnSub.setMinHeight(50);

rowThree.getChildren().addAll(btn1,btn2,btn3,btnSub);

mainBox.getChildren().add(rowThree);

HBox rowFour = new HBox();

Button btnC = new Button("C");

btnC.setMinWidth(50);

btnC.setMinHeight(50);

Button btn0 = new Button("0");

btn0.setMinWidth(50);

btn0.setMinHeight(50);

Button btnDot = new Button(".");

btnDot.setMinWidth(50);

btnDot.setMinHeight(50);

Button btnAdd = new Button("+");

btnAdd.setMinWidth(50);

btnAdd.setMinHeight(50);

rowFour.getChildren().addAll(btnC,btn0,btnDot,btnAdd);

mainBox.getChildren().add(rowFour);

HBox rowFive = new HBox();

Button btnEq = new Button("=");

btnEq.setMinWidth(200);

btnEq.setMinHeight(50);

rowFive.getChildren().add(btnEq);

mainBox.getChildren().add(rowFive);

root.getChildren().add(mainBox);

primaryStage.setScene(scene);

primaryStage.setTitle("GUI Calculator");

primaryStage.show();

}

}

4 0
3 years ago
Lynx eat snowshoe hares, and snowshoes hears eat plants. Which term can be applied to the lynx in this food chain example? Prima
erastova [34]

Answer:

primary consumer because YES

3 0
2 years ago
Windmills slow the air and cause it to fill a larger channel as it passes through the blades. Consider a circular windmill with
Scilla [17]

Answer:

DIAMETER  = 9.797 m

POWER = \dot W = 28.6 kW

Explanation:

Given data:

circular windmill diamter D1 = 8m

v1 = 12 m/s

wind speed = 8 m/s

we know that specific volume is given as

v =\frac{RT}{P}

  where v is specific volume of air

considering air pressure is 100 kPa and temperature 20 degree celcius

v =  \frac{0.287\times 293}{100}

v = 0.8409 m^3/ kg

from continuity equation

A_1 V_1 = A_2 V_2

\frac{\pi}{4}D_1^2 V_1 = \frac{\pi}{4}D_1^2 V_2

D_2 = D_1 \sqrt{\frac{V_1}{V_2}}

D_2 = 8 \times \sqrt{\frac{12}{8}}

D_2 = 9.797 m

mass flow rate is given as

\dot m = \frac{A_1 V_1}{v} = \frac{\pi 8^2\times 12}{4\times 0.8049}

\dot m = 717.309 kg/s

the power produced \dot W = \dot m \frac{ V_1^2 - V_2^2}{2} = 717.3009 [\frac{12^2 - 8^2}{2} \times \frac{1 kJ/kg}{1000 m^2/s^2}]

\dot W = 28.6 kW

8 0
3 years ago
Consider the expansion of a gas at a constant temperature in a water-cooled piston-cylinder system. The constant temperature is
Leona [35]

Answer:

Q_{in} = W_{out} = nRT ln (\frac{V_{2}}{V_{1}})

Explanation:

According to the first thermodynamic law, the energy must be conserved so:

dQ = dU - dW

Where Q is the heat transmitted to the system, U is the internal energy and W is the work done by the system.

This equation can be solved by integration between an initial and a final state:

(1) \int\limits^1_2 {} \, dQ = \int\limits^1_2 {} \, dU - \int\limits^1_2 {} \, dW

As per work definition:

dW = F*dr

For pressure the force F equials the pressure multiplied by the area of the piston, and considering dx as the displacement:

dW = PA*dx

Here A*dx equals the differential volume of the piston, and considering that any increment in volume is a work done by the system, the sign is negative, so:

dW = - P*dV

So the third integral in equation (1) is:

\int\limits^1_2 {- P} \, dV

Considering the gas as ideal, the pressure can be calculated as P = \frac{n*R*T}{V}, so:

\int\limits^1_2 {- P} \, dV = \int\limits^1_2 {- \frac{n*R*T}{V}} \, dV

In this particular case as the systems is closed and the temperature constant, n, R and T are constants:

\int\limits^1_2 {- \frac{n*R*T}{V}} \, dV = -nRT \int\limits^1_2 {\frac{1}{V}} \, dV

Replacion this and solving equation (1) between state 1 and 2:

\int\limits^1_2 {} \, dQ = \int\limits^1_2 {} \, dU + nRT \int\limits^1_2 {\frac{1}{V}} \, dV

Q_{2} - Q_{1} = U_{2} - U_{1} + nRT(ln V_{2} - ln V_{1})

Q_{2} - Q_{1} = U_{2} - U_{1} + nRT ln \frac{V_{2}}{V_{1}}

The internal energy depends only on the temperature of the gas, so there is no internal energy change U_{2} - U_{1} = 0, so the heat exchanged to the system equals the work done by the system:

Q_{in} = W_{out} = nRT ln (\frac{V_{2}}{V_{1}})

4 0
4 years ago
Other questions:
  • 8. In a closed hydraulic brake system, the hydraulic pressure:
    8·2 answers
  • "A fluid at a pressure of 7 atm with a specific volume of 0.11 m3/kg is constrained in a cylinder behind a piston. It is allowed
    6·1 answer
  • Part of the basic procedures is the vehicle check. What does that mean?
    7·1 answer
  • Classify the terms as related to a thermal system or mechanical system.
    8·1 answer
  • To test the effects of a new fertilizer, 100 plots were divided in half. Fertilizer A is randomly applied to one half, and B to
    13·2 answers
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • An engineer is trying to build a new measurement tool. Which step should the engineer complete first? A. Design a model of the t
    8·1 answer
  • Water at 20◦C is pumped through 1000 ft of 0.425 ft diameter pipe at a volumetric flowrate of 1 ft3/s through a cast iron pipe t
    14·1 answer
  • Which design activity is part of the design for manufacturability (DFM) methodology?
    10·1 answer
  • Which one of these is not a successful budgeting strategy
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!