Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Architecture EKT 422 Chapter 10 Instruction Sets: Characteristics and Functions (cont.)

Similar presentations


Presentation on theme: "Computer Architecture EKT 422 Chapter 10 Instruction Sets: Characteristics and Functions (cont.)"— Presentation transcript:

1 Computer Architecture EKT 422 Chapter 10 Instruction Sets: Characteristics and Functions (cont.)

2 Stacks Is an ordered set of elements. Accessed once at a time Point of access call top of the stack. Last element in stack call base of the stack. Last-in-first-out (LIFO)

3 Stack-oriented Operation PUSH —Append a new element on top of the stack POP —Delete the top element of the stack Unary operation —Perform operation on top of the stack and replace top element with the result Binary operation —Perform operation on top two element of the stack. It will delete top two element of the stack and replace it with the result of operation

4 Basic stack operation J K L M.... J K L M.... J K L M.... J X K L M.... I SP INITIAL STATEAFTER PUSHAFTER POP AFTER MULTIPLICATION OPERATION

5 Exercise 1 Writing a program to compute equation below using zero-address machine. X= (A + B x C) / ((D + E) x F) Draw the diagram to describe the stack process

6 Answer 1 PUSH A PUSH B PUSH C MUL ADD PUSH D PUSH E ADD PUSH F MUL DIV POP X


Download ppt "Computer Architecture EKT 422 Chapter 10 Instruction Sets: Characteristics and Functions (cont.)"

Similar presentations


Ads by Google