Download presentation
Presentation is loading. Please wait.
Published byBrittany Hubbard Modified over 8 years ago
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.