Back to Top




Stack Organization





Share |


STACK ORGANIZATION
Stack is a storage structure that stores information in such a way that the last item stored is the first item retrieved. It is based on the principle of LIFO (Last-in-first-out). The stack in digital computers is a group of memory locations with a register that holds the address of top of element. This register that holds the address of top of element of the stack is called Stack Pointer.

Stack Operations
The two operations of a stack are:

  1. Push:        Inserts an item on top of stack.
  2. Pop:          Deletes an item from top of stack.

Implementation of Stack
In digital computers, stack can be implemented in two ways:

  1. Register Stack
  2. Memory Stack

 

Register Stack


A stack can be organized as a collection of finite number of registers that are used to store temporary information during the execution of a program. The stack pointer (SP) is a register that holds the address of top of element of the stack.

Memory Stack


A stack can be implemented in a random access memory (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 stack pointer.






W3Professors



VacationBazaar



Relevant-Education



Our Other Websites





Increase Page Rank