RAM Memory Organization and Its Types of Memory

Memory is an important component of microcontrollers or CPUs for storing information that is used to control electronics projects. Internally, memory has been divided into several parts that consists of special types of registers those help to store data. There are two types of memories such as RAM memory and ROM memory, in many two are available in similar way. Here we will discuss about RAM memory organization of 8051 and its registers. This information is helpful for the embedded system designers to write program easily.


RAM Memory
RAM Memory

RAM Memory Organization of 8051 Microcontroller:

8051 microcontroller has 256 bytes of RAM memory, which is divided in two ways, such as 128 bytes for special function registers (SFR) and 128 bytes for general purpose memory. RAM memory organization contains a group of general purpose registers which are used to store information with a fixed memory address register, and SFR memory contains all peripheral related registers like ‘B’ register, Accumulator, Counters or Timers and interrupt related registers.

RAM Memory Organization:

A group of storage locations in RAM memory is called RAM memory organization which can be controlled by PSW register value. 8051 microcontroller RAM memory internally divided into a set of storage locations such as banks, bit-addressable area, and scratch-pad area.

RAM Memory Organization
RAM Memory Organization

BANKS:

The banks contain various general purpose registers such as R0-R7, and all such registers are byte-addressable registers that store or remove only 1-byte of data. The banks are divided into four different banks such as;

  • Bank0
  • Bank1
  • Bank2
  • Bank3

Each bank consists 8-general purpose registers and has own address to categorize stored information. These can be selected by using the values of PSW register (i,e ,RS1, RS0). The bank1, bank2, bank3 can be used as stack pointer area. Whenever stack memory organization  is full, then the data stores in scratch pad area. Default address of stack pointer is 07h.

Bank Registers
Bank Registers

Bit Addressable Area:

Bit addressable area consists of bit-addressable registers that store or remove only 1-bit of data. This area has total 128 addresses starting from 00h to 07Fh which represent for data storage location. Bit addressable area is formed close to the register banks. They are designed from address 20H to 2FH.  Bit addressable area mainly used to store bit variables from an application program, like device output status, such as LEDs or motors (ON and OFF) etc,. As need only bit addressable area to store this status. If we consider byte addressable area for storing this status as some memory will be wasted.

Bit Addressable Area
Bit Addressable Area

Scratch Pad Area:

Scratch pad area consists of byte addressable registers that store or remove only 1-bit of data. It is formed close to the bit addressable area. It is formed from 30H to 7FH. Scratch pad area mainly used to store byte variables from an application program, like print a device output status, such as motor directions (forward and backward) etc.,. Whenever stack pointer area has filled, then data will be stored in scratch pad area. Scratch pad area consists 80 bytes of memory.

Types of RAM Memories:

RAM memory classified into two types of memories such as SRAM and DRAM memory.

SRAM (Static Random Access Memory):

Static Random Access Memory is a type of RAM that retains the information in its memory as long as power is being supplied. Static RAM provides faster access to the data and is more expensive compared with DRAM. SRAM does not need to be refreshed periodically.

Static Random Access Memory
Static Random Access Memory

In SRAM, each bit is stored in four transistors that form two cross coupled inverters.  Two additional transistors – types provide to control the access to the storage cells during read and write operations. Generally, SRAM uses six transistors to store each memory bit. These Storage Cells have two stable states which are used to denote ‘0’ and ‘1’.

DRAM (Dynamic Random Access Memory):

DRAM is a type of RAM module that stores each bit of data within a separate capacitor.  This is a proficient way to store the data in memory because it requires less physical space to store data.

DRAM can hold more amounts of data by a particular chip size. Capacitors in DRAM are need to be constantly recharged to keep their charge, thus, DRAM requires more power.

Dynamic Random Access Memory
Dynamic Random Access Memory

Each DRAM memory chip consists of a storage location or memory cells.  It is made up of capacitor and transistor which can hold either active or inactive state. Each DRAM cell is referred to as a bit.

When DRAM cells are in active state, then charge is at high state. When DRAM cells are an  inactive state, then charge is below a certain level.

Cache Memory Orgonization:

Cache memory is a type of memory which is used to hold the frequently used data from main memory locations. The cache memory is placed close to the CPU. Cache memory starts from 00h to 0Fh. Cache memory is relatively small, consisted with 8k and 16k but it works effectively. It is a byte addressable memory and  it stores and remove only 1-bit of data. The cache memory filled from the main memory when CPUs require the instructions. The cache memory mainly used for reduce the average time to the access memory.

SRAM & DRAM Advantages and Applications:

Advantages of SRAM:

  • The SRAM provides a  large storage capacities on on-chip memories
  • A typically the SRAMs have very low latency and high performance
  • It is very easy to design and interface compared with other memories

Advantages of DRAM:

  • The storage capacity is very high
  • It is a low cost and high performance device.

This article gives a brief information about memory organization of 8051 microcontroller, types of RAM memories, bank registers and cache memory organization. For more information regarding the memory organization and technical assistance for your microcontroller based projects, you can approach us by posting your comments in the comment section below.