0% found this document useful (0 votes)
74 views6 pages

Stack Organization: Stack: A Storage Device That Stores

The document discusses different aspects of stack organization. A stack is a data structure that follows the last-in, first-out (LIFO) principle, where the last item added is the first item retrieved. A stack pointer tracks the top of the stack. The two main operations are push, which adds an item to the stack, and pop, which removes an item from the top of the stack. Stacks can be implemented using registers or a portion of memory, with a register serving as the stack pointer.

Uploaded by

leo hajela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views6 pages

Stack Organization: Stack: A Storage Device That Stores

The document discusses different aspects of stack organization. A stack is a data structure that follows the last-in, first-out (LIFO) principle, where the last item added is the first item retrieved. A stack pointer tracks the top of the stack. The two main operations are push, which adds an item to the stack, and pop, which removes an item from the top of the stack. Stacks can be implemented using registers or a portion of memory, with a register serving as the stack pointer.

Uploaded by

leo hajela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 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