Question

In: Computer Science

A calculation engine is being built to set up an order-of-operations for solving equations. The priority...

A calculation engine is being built to set up an order-of-operations for solving equations. The priority of the operations is as follows:

1. Parentheses, Priority 1 highest

2. Exponents, Priority 2

3. Multiplication, Priority 3

4. Division, also Priority 3

5. Modulus, also Priority 3

6. Addition, Priority 4, Lowest

7. Subtraction, Also priority 4

Each of bulleted items in the list above is represented by a one-bit input wire in a control circuit system, for a total of 7 inputs. The outputs are binary integers 1 through 4.

Use combinational logic and gate logic to create a piece of control circuitry that will assign the correct 2-bit binary integer based on the system priority. The output should be the highest priority among the inputs.

Include a short, well-written description about the approach you chose. Do not include a 128-line truth table. If you use this approach, you are going about it the wrong way. Remember: Divide and Conquer!

the final set of outputs on question 4.4 would be in the form of {001,010,011,100}.

Solutions

Expert Solution

mathametical statement

=7+3*5

Interpretated 2 types

1st type 2nd type

=10*5 =7+15

=50 =22

completely unacceptable because of two different mode of operations

The order of operation must be start with

  • Parantheses ()
  • exponents
  • multiplication and division
  • addition and subraction

EX:

=7+34*4/2-5*6

=10*4/2-5*6

=40/2-5*6

=20-30

=-10

The simple answer is "Yes" C++ follows the standard order of precedence.we would note that in PEMDAS the E stands for "exponent" and there is no way to express that in C++ you need to make a function call to achieve it but the rest is correct. P Parathasis first. E Exponent second. MD Multiplication and Division third (have the same precedence) AS Addition and Subtraction fourth (have the same precedence) MD happen left to right AS happen left to right

5/9 * (34/.2)

it will have a hard time computing this formula due to the fact that the parentheses are at the end and not the front. Is this correct?

Wrong. The above expression is well define in maths and in C++ and has the same meaning.

(34/.2) *5/9

my formula works. Any tips, pointers, guidance is appreciated.

These are not the same expression. Multiplication and division have the same precedence and are applied left to right. You have changed the order of how these operators are applied. But you say they are supposed to be associative (i.e. order is not important). That is true. But you also have to throw in the type information. One easy thing to forget is that integer division is not what you expect (it throws away the remainder).

Version 1:

5/9 * (34/.2)

34/.2 => P1 170.0

5/9 => P2 0 // Integer division

P2 * P1 => P3 0

Version 2

(34/.2) *5/9

34/.2 => P1 170.0

P1 * 5 => P2 850.0

P2 / 9 => P3 94.4


Related Solutions

3. According to the order of operations in solving equations, which step should come first? Simplify...
3. According to the order of operations in solving equations, which step should come first? Simplify inside parentheses and brackets. Multiply and divide from left to right. Add and subtract from left to right. 5.Scarcity is a condition that is everywhere and always, since it is based upon two assumptions that reflect permanent universal conditions. The assumptions are that more output will satisfy more wants and A. the world has limited productive resources. B. there are limited wants. C. the...
Set up the calculation to arrive at the market value of a new bond having a...
Set up the calculation to arrive at the market value of a new bond having a face amount of $1,000, the annual interest rate of 7% payable semiannually, callable at the end of five years (call price of 106) and 25 years remaining maturity at a 6% yield to call. (Do not use a calculator. Show the appropriate equation and data substitution.) At this yield will the bond trade at par, a discount or a premium?
3) Laplace Transform and Solving first order Linear Differential Equations with Applications The Laplace transform of...
3) Laplace Transform and Solving first order Linear Differential Equations with Applications The Laplace transform of a function, transform of a derivative, transform of the second derivative, transform of an integral, table of Laplace transform for simple functions, the inverse Laplace transform, solving first order linear differential equations by the Laplace transform Applications: a)))))) Series RL circuit with ac source [electronics]
4) Laplace Transform and Solving second order Linear Differential Equations with Applications The Laplace transform of...
4) Laplace Transform and Solving second order Linear Differential Equations with Applications The Laplace transform of a function, transform of a derivative, transform of the second derivative, transform of an integral, table of Laplace transform for simple functions, the inverse Laplace transform, solving first order linear differential equations by the Laplace transform Applications: a) Series RLC circuit with dc source b) Damped motion of an object in a fluid [mechanical, electromechanical] c) Forced Oscillations [mechanical, electromechanical] You should build the...
Set up the system of equations that are needed to be solved using Lagrange multipliers in...
Set up the system of equations that are needed to be solved using Lagrange multipliers in order to find the dimensions of the rectangular box with an open-top, having volume 4000 m^3 with a minimal surface area.
Activity 2: Transcription Imagine that you’re having a house built. The architect draws up a set...
Activity 2: Transcription Imagine that you’re having a house built. The architect draws up a set of blueprints for the builder. The builder, in turn, has to hire several subcontractors for the electrical, plumbing, and heating systems. The builder doesn’t wish to give up the original set of blueprints, so copies are made for each of the subcontractors. This same principle applies to a cell. The nucleus contains the master set of blueprints, the DNA. DNA molecules are needed to...
A) Please set up The Simultaneous Equations for both plans and solve for the breakeven point...
A) Please set up The Simultaneous Equations for both plans and solve for the breakeven point where Plan A and Plan B will have the same cost outlay. ( B)Which plan will be cheaper in the short run and which plan will be cheaper in the long run? Please show Graph.
The SIR Model for the Spread of Disease Set up the three differential equations and perform...
The SIR Model for the Spread of Disease Set up the three differential equations and perform a simulation of the solution of the three equations. Start with a Susceptible (S) of 327,500,000 (the population of the US) and I value of 1 and an R value of zero. Derive your constants, r,a so your simulation matches current values of I and R. Use a dt of 1 day.
Set up the appropriate form of the particular solution to each of the differential equations below,...
Set up the appropriate form of the particular solution to each of the differential equations below, but do NOT determine the values of the coefficients. (a) y′′ +10y′ +25y=2e^(5t) +te^(−5t) b) y′′ +9y=5t^2 +4cos(3t)+6e^(3t)
SET UP BUT DO NOT SOLVE the following system of linear equations: A company sells three...
SET UP BUT DO NOT SOLVE the following system of linear equations: A company sells three sizes of fruit trays. The small size contains 200 gr of watermelons and 100 gr of grapes. The medium size contains 400 gr of watermelons, 100 gr of pineapples, and 300 gr of grapes. The large size contains 600 gr of watermelons, 200 gr of pineapples, and 400 gr of grapes. Suppose that the company receives an order for 28 kg of watermelons, 6...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT