Stack Organization
An Overview of the LIFO Data Structure
Name : Somanjan Pramanik
Roll No. : 35000322042
Subject : Computer Architecture
College : R.K.M.G.E.C.
Introduction to
Stack
A Stack is a linear data structure that follows
a particular order in which the operations are
performed. The order may be LIFO(Last In
First Out) or FILO(First In Last Out). LIFO
implies that the element that is inserted last,
comes out first and FILO implies that the
element that is inserted first, comes out last.
Basic operation of Stack
Push: Adds an item
to the top of the
stack.
Pop: Removes the
item from the top of
the stack.
Peek/Top: Returns
the top item without
removing it.
Types
Stack
Organization
Register Stack Memory Stack
Register
Stack
The stack can be arranged as a set of memory words or registers.
Consider a 64-word register stack arranged as displayed in the
figure. The stack is a set of memory words or registers, with the
stack pointer register holding the address of the element at the
top. The stack consists of three elements: A, B, and C. The top
element is popped by reading memory word at address 3 and
decrementing the stack pointer by 1, while B is pushed by
incrementing the stack pointer by 1 and inserting a new word.
The stack pointer includes 6 bits, because 26 = 64, and the SP
cannot exceed 63 (111111 in binary). After all, if 63 is incremented
by 1, therefore the result is 0(111111 + 1 = 1000000). SP holds only
the six least significant bits. If 000000 is decremented by 1 thus
the result is 111111.
Push Pop operation of Register Stack
SP SP + 1
←
It can increment
stack pointer
K[SP] DR
←
It can write element
on top of the stack
If (SP = 0) then (FULL
1)
←
Check if stack is full
EMTY 0
←
Mark the stack not
empty
DR K[SP]
←
It can read an
element from the top
of the stack
SP SP – 1
←
It can decrement the
stack pointer
If (SP = 0) then (EMTY
1)
←
Check if stack is
empty
FULL 0
←
Mark the stack not
full
Push Pop
A stack is a storage device where the last stored item is retrieved first.
A computer system follows a memory stack organization, with a
portion of memory assigned to a stack operation in the CPU, using
the processor register as a Stack Pointer.
Memory
Stack
Program Counter
(PC): It is a register
that points to the
address of the next
instruction that is
going to be
executed in the
program.
Address Register
(AR): This register
points at the
collection of data
and is used during
the execute phase
to read an
operand.
Stack Pointer (SP):
It points at the top
of the stack and is
used to push or pop
the data items in or
from the stack
Function & Push Pop
operation
As we can see in the figure, these three registers are connected to
a common address bus and either one of them can provide an
address for memory.
The Stack Pointer points to address 3001, and the stack grows
with decreasing addresses. The first item is stored at 3001, the
second at 3000, and the last at 2000. The Data Register obtains
and reads data from the Stack, with items stored at 3001, 3000,
and 2000.
SP SP-1
←
M[SP] DR
←
DR M[SP]
←
SP SP+1
←
Push Pop
• Simple and Efficient: Stacks are easy
to implement and understand, ideal
for managing data with LIFO access.
• Efficient Memory Use: Stacks handle
memory allocation and deallocation,
especially for function calls.
• Quick Execution: Stacks are suitable
for managing small datasets in high-
performance scenarios like
expression evaluation and recursive
function management.
• Limited Memory: Stacks' fixed
size can lead to stack overflow if
too much data is pushed.
• No Random Access: Unlike
arrays, stacks only allow top
element access, inefficient for
certain applications.
• Risk of Overflow: Excessive
recursive calls or large data
storage can cause stack overflow,
leading to program crashes.
Advantages &
Disadvantages
Conclusio
n
Reference
s
Stack organization is a crucial computer architecture concept
for memory management, function calls, and program
execution, using a Last-In-First-Out (LIFO) structure. It's
essential for CPU operations but requires careful management
in limited memory resources.
 www.google.com
 www.chatgpt.com
 www.geeksforgeeks.com
 www.tutorialspoint.com
Thank
You

More Related Content

PPTX
Stack and its usage in assembly language
PDF
7BCEE2A - UNIT V - STACK ORGANIZATION.pdf
DOCX
Computer Organization and 8085 microprocessor notes
PPTX
Stack Operations
PDF
Why does the stack use a FILO (first in last out) schemeSolutio.pdf
PPTX
The presentation on stack data structure
PPTX
CS304PC:Computer Organization and Architecture Session 11 general register or...
PDF
Central processing unit
Stack and its usage in assembly language
7BCEE2A - UNIT V - STACK ORGANIZATION.pdf
Computer Organization and 8085 microprocessor notes
Stack Operations
Why does the stack use a FILO (first in last out) schemeSolutio.pdf
The presentation on stack data structure
CS304PC:Computer Organization and Architecture Session 11 general register or...
Central processing unit

Similar to EC502fggggggggggggggggggggmmmmmmmmmmmmmmmmmmc (20)

PDF
Lect12 organization
PPT
Addressing modes (detailed data path)
PPTX
PPTX
Exploring the Stack Stack Description.pptx
PPTX
Stack organization
PPT
data structure, stack, stack data structure
PPT
computer organisation unit 3 presentatio
PPSX
Microprocessor architecture II
DOCX
Stacks in data structure
PPTX
stack.pptx stack overflow in computer organisations
PDF
PPT
Lecture 2c stacks
PPTX
Ch 3 CPU.pptx Architecture computer organization
PPTX
Lecture#5 - Stack ADT.pptx
DOCX
Central processing unit
PPTX
My lecture stack_queue_operation
PDF
Algorithm and Data Structure - Stack
PDF
Chapter 4 stack
PPTX
Data structure
Lect12 organization
Addressing modes (detailed data path)
Exploring the Stack Stack Description.pptx
Stack organization
data structure, stack, stack data structure
computer organisation unit 3 presentatio
Microprocessor architecture II
Stacks in data structure
stack.pptx stack overflow in computer organisations
Lecture 2c stacks
Ch 3 CPU.pptx Architecture computer organization
Lecture#5 - Stack ADT.pptx
Central processing unit
My lecture stack_queue_operation
Algorithm and Data Structure - Stack
Chapter 4 stack
Data structure
Ad

Recently uploaded (20)

PPTX
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
PDF
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
PDF
AI agent, robotics based Smart Construction 2025
PPT
Unit - I.lathemachnespct=ificationsand ppt
PPTX
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
PDF
Recent Trends in Network Security - 2025
PDF
Electrical & Computer Engineering: An International Journal (ECIJ)
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPTX
Soft Skills Unit 2 Listening Speaking Reading Writing.pptx
PDF
Application of smart robotics in the supply chain
PPTX
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
PDF
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
PPTX
quantum theory on the next future in.pptx
PDF
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
PDF
Project_Mgmt_Institute_- Marc Marc Marc.pdf
PPTX
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
PDF
Module 1 part 1.pdf engineering notes s7
PPTX
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PDF
IAE-V2500 Engine Airbus Family A319/320
PDF
August 2025 Top read articles in International Journal of Database Managemen...
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
AI agent, robotics based Smart Construction 2025
Unit - I.lathemachnespct=ificationsand ppt
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
Recent Trends in Network Security - 2025
Electrical & Computer Engineering: An International Journal (ECIJ)
B461227.pdf American Journal of Multidisciplinary Research and Review
Soft Skills Unit 2 Listening Speaking Reading Writing.pptx
Application of smart robotics in the supply chain
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
quantum theory on the next future in.pptx
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
Project_Mgmt_Institute_- Marc Marc Marc.pdf
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
Module 1 part 1.pdf engineering notes s7
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
IAE-V2500 Engine Airbus Family A319/320
August 2025 Top read articles in International Journal of Database Managemen...
Ad

EC502fggggggggggggggggggggmmmmmmmmmmmmmmmmmmc

  • 1. Stack Organization An Overview of the LIFO Data Structure Name : Somanjan Pramanik Roll No. : 35000322042 Subject : Computer Architecture College : R.K.M.G.E.C.
  • 2. Introduction to Stack A Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). LIFO implies that the element that is inserted last, comes out first and FILO implies that the element that is inserted first, comes out last.
  • 3. Basic operation of Stack Push: Adds an item to the top of the stack. Pop: Removes the item from the top of the stack. Peek/Top: Returns the top item without removing it.
  • 5. Register Stack The stack can be arranged as a set of memory words or registers. Consider a 64-word register stack arranged as displayed in the figure. The stack is a set of memory words or registers, with the stack pointer register holding the address of the element at the top. The stack consists of three elements: A, B, and C. The top element is popped by reading memory word at address 3 and decrementing the stack pointer by 1, while B is pushed by incrementing the stack pointer by 1 and inserting a new word. The stack pointer includes 6 bits, because 26 = 64, and the SP cannot exceed 63 (111111 in binary). After all, if 63 is incremented by 1, therefore the result is 0(111111 + 1 = 1000000). SP holds only the six least significant bits. If 000000 is decremented by 1 thus the result is 111111.
  • 6. Push Pop operation of Register Stack SP SP + 1 ← It can increment stack pointer K[SP] DR ← It can write element on top of the stack If (SP = 0) then (FULL 1) ← Check if stack is full EMTY 0 ← Mark the stack not empty DR K[SP] ← It can read an element from the top of the stack SP SP – 1 ← It can decrement the stack pointer If (SP = 0) then (EMTY 1) ← Check if stack is empty FULL 0 ← Mark the stack not full Push Pop
  • 7. A stack is a storage device where the last stored item is retrieved first. A computer system follows a memory stack organization, with a portion of memory assigned to a stack operation in the CPU, using the processor register as a Stack Pointer. Memory Stack Program Counter (PC): It is a register that points to the address of the next instruction that is going to be executed in the program. Address Register (AR): This register points at the collection of data and is used during the execute phase to read an operand. Stack Pointer (SP): It points at the top of the stack and is used to push or pop the data items in or from the stack
  • 8. Function & Push Pop operation As we can see in the figure, these three registers are connected to a common address bus and either one of them can provide an address for memory. The Stack Pointer points to address 3001, and the stack grows with decreasing addresses. The first item is stored at 3001, the second at 3000, and the last at 2000. The Data Register obtains and reads data from the Stack, with items stored at 3001, 3000, and 2000. SP SP-1 ← M[SP] DR ← DR M[SP] ← SP SP+1 ← Push Pop
  • 9. • Simple and Efficient: Stacks are easy to implement and understand, ideal for managing data with LIFO access. • Efficient Memory Use: Stacks handle memory allocation and deallocation, especially for function calls. • Quick Execution: Stacks are suitable for managing small datasets in high- performance scenarios like expression evaluation and recursive function management. • Limited Memory: Stacks' fixed size can lead to stack overflow if too much data is pushed. • No Random Access: Unlike arrays, stacks only allow top element access, inefficient for certain applications. • Risk of Overflow: Excessive recursive calls or large data storage can cause stack overflow, leading to program crashes. Advantages & Disadvantages
  • 10. Conclusio n Reference s Stack organization is a crucial computer architecture concept for memory management, function calls, and program execution, using a Last-In-First-Out (LIFO) structure. It's essential for CPU operations but requires careful management in limited memory resources.  www.google.com  www.chatgpt.com  www.geeksforgeeks.com  www.tutorialspoint.com