Lecture 5-6 Computer Organization and Architecture
Lecture 5-6 Computer Organization and Architecture
Lecture 5-6 Computer Organization and Architecture
CSEN 2202
Lecture 5 – 6
22/01/2020
• SP SP – 1
• Top of stack < memory address>
• Disadvantages
• Stack becomes the bottleneck
• Little ability for parallelism or pipelining
• Difficult to write an optimizing compiler for stack architectures
Arithmetic Expression Evaluation
• Infix notation
• Example: (A + B) * (C + D)
• Polish Notation (or Prefix notation)
• Example: +AB (in Prefix) means A + B (in Infix)
• No parenthesis required
• Reverse Polish Notation (or Postfix notation)
• Example: AB+ (in Postfix) means A + B (in Infix)
• No parenthesis required
• Stack oriented computers are better suited to postfix notation than Infix
notation
• Example: (A +B) * [C/(D-E) + F] is equivalent to AB+CDE-/F+*
• Explain with a Numerical example (40, 60, 100, 50, 30, 35) → 4000
Thank you