The instructions are just PUSH and POP The operands in paren

The instructions are just PUSH and POP. The operands in parentheses are just shown so we know what is being PUSHed and POPed Equation: X = (((A * B * C) + 12)-2 Postfix Form: AB * C * 12 + 2 - The instructions are: AB*C*12 + 2 - PUSH (A) PUSH (B) MUL PUSH (C) MUL PUSH (12) ADD PUSH (2) SUB POP(X) Now attempt the following STACK exercise: Equation C = 25 * 7 + 6 Equations A = (B * C)/4 Expression: A = .5(b * h) Equation: x = (y - z)/8 Expression: X = V * R + 2 Expression: a = (b + c + d + e)/4 Expression: X = 4 + y * Z

Solution

4)  c = 25 * 7 + 6

Postfix Form: 25 7 * 6 +

the instructions are : 25 7 * 6 +

stack Operation :

PUSH(25)

PUSH (7)

MUL

PUSH (6)

ADD

POP(c)

5) A = ( B * C ) / 4

Postfix Form: B C * 4 /

Stack operation:

                        PUSH (B)

PUSH (C)

MUL

PUSH (4)

DIV

POP (A)

6) A=.5(b * h)

Postfix: .5 b h * *

Stack operation:

                        PUSH (.5)

                        PUSH (b)

                        PUSH (h)

                        MUL

                        MUL

                        POP (A)

7) x = (y-z)/8

Postfix notation is : y z – 8 /

Stack operation :

            PUSH (y)

            PUSH (z)

            SUB

            PUSH (8)

            DIV

            POP (x)

8) X = V * R + 2

Postfix notation : V R * 2 +

Stack operation:

            PUSH (V)

            PUSH (R)

            MUL

            PUSH (2)

            ADD

            POP(X)

9) a = (b + c + d + e) / 4

Postfix notation : bc+d+e+4/

Stack operation :

            PUSH (b)

            PUSH(c)

            ADD

            PUSH (d)

            ADD

            PUSH (e)

            ADD

            PUSH (4)

            DIV

            POP (a)

10) X = 4 + Y * Z

Postfix notation : 4 Y + Z *

Stack operation :

            PUSH (4)

            PUSH (Y)

            ADD

            PUSH (Z)

            MUL

            POP (X)

 The instructions are just PUSH and POP. The operands in parentheses are just shown so we know what is being PUSHed and POPed Equation: X = (((A * B * C) + 12)-
 The instructions are just PUSH and POP. The operands in parentheses are just shown so we know what is being PUSHed and POPed Equation: X = (((A * B * C) + 12)-
 The instructions are just PUSH and POP. The operands in parentheses are just shown so we know what is being PUSHed and POPed Equation: X = (((A * B * C) + 12)-

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site