Stack Organization & Addressing Mode
Stack Organization & Addressing Mode
Stack Organization & Addressing Mode
Addressing Mode
By
Dr. Shivani Agarwal
Formats of writing Languages:-
1. Register Transfer:- copying the content of one register to another
R2 R1
2. Control Function:- Similar to if statement
P: R2 R1
if(P=1) then (R2 R1)
3. Simultaneous Operations:- Two or more operations are occur
P: R2 R1,MAR IR
R1
N
T: Load
Control(T) R2 clock
Register Stack
Insertion Operation
Deletion Operation
• In 64 stack word it is (0-63) SP contains 6 bits it cant
exceed from 6 to 7 or any number so max value is
111111 if its exceed then its 0.
• 111111+1=1000000 ,this exceed 1 represents flag
FULL1 and buffer is 0,this condition represents
STACK OVERFLOW.
• When the buffer is 0 (000000) and it is decremented by
1 so the result is 111111 it is 63 then EMPTY1,
CONDITION OF STACK UNDERFLOW.
Memory Stack
A Portion of computer memory divided in
to 3 segments program, data and stack.
• PC point the address of next instruction
and it is used during the fetch phase to PC
read an instruction
• AR points at an array pointer of data AR
- PUSH: SP SP - 1
M[SP] DR
- POP: DR M[SP]
SP SP + 1
• Reverse Polish notation (RPN) is a method for representing expressions in which the operator
symbol is placed after the arguments being operated on. Polish notation, in which the operator
comes before the operands, was invented in the 1920s by the Polish mathematician Jan Lucasiewicz.
• Arithmetic Expressions: A + B
• A+B Infix notation
• +AB Prefix or Polish notation
• AB+ Postfix or reverse Polish notation
Evaluation of Arithmetic Expressions
• Any arithmetic expression can be expressed in parenthesis-free
Polish notation, including reverse Polish notation
Instruction Format