Stack Organization: Stack: A Storage Device That Stores

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 6

Stack Organization

 Stack: A storage device that stores


information in such a manner that the item
stored last is the first item retrieved.

 Also called last-in first-out (LIFO) list.


Useful for compound arithmetic operations
and nested subroutine calls.
Stack Organization
 Stack pointer (SP): A register that holds
the address of the top item in the stack.
SP always points at the top item in the
stack
 Stack Operations : The two operations are
• Push: Operation of insertion or to insert an
item into the stack.
• Pop: Operation of deletion or to retrieve an
item from the stack.
IMPLEMENTATION OF STACK
In computer, stack can be implemented in
two ways –

 Register Stack
 Memory Stack
REGISTER STACK
• A stack can be
organized as a
collection of a finite
number of registers
that are used to
store temporary
information.
REGISTER STACK
• In a 64-word stack, the
stack pointer contains 6 bits.

• The one-bit FULL register


is set to 1 when the stack is
full;
EMPTY register is 1 when
the stack is empty.

• The data register holds the


data to be written into or
read from the stack.
MEMORY STACK

A stack can be implemented in a RAM attached


to a CPU. The implementation of a stack in the
CPU is done by assigning a portion of memory
to a stack operation and using a processor
register as a stack pointer. The starting
memory location of the stack is specified by
the processor register as a stack pointer.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy