1 / 6

Computer Architecture EKT 422

Computer Architecture EKT 422. Chapter 10 Instruction Sets: Characteristics and Functions (cont.). 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).

jubal
Download Presentation

Computer Architecture EKT 422

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 SP I SP SP J J J SP K J X K K K L L L L M M M M . . . . . . . . . . . . . . . . AFTER MULTIPLICATION OPERATION INITIAL STATE AFTER PUSH AFTER POP

  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

More Related