Types and Selection of Memory for an embedded system
Memory is one of the most important and essential parts of any processing system. Selecting from the available types of memory should be carefully done while developing an embedded system.
So, what is memory?
Memory is the physical storage element or device used for storing two kinds of information.
- Data or information
- Program instructions or opcodes
The embedded system fetches the data from the memory, processes and produces output data, which is again stored in the memory. The stored data can be intermediate data that is produced during the execution.
Program information is nothing but the instructions or opcode that executes the function performed by the processor. When the program is executed, the CPU fetches the instruction from the memory and executes it.
Both these instructions and data are stored in the memory either temporarily or permanently, depending on the requirement. Accordingly, they have been classified into several types. Let us discuss them in detail.
Types of Memory
Based on whether the data is stored temporarily or permanently, the memory can be classified into Volatile memory and non-volatile memory.
Volatile memories will retain the data as long as the power is applied to the memory device. When the power is turned off, the contents will be erased from the memory.
It is used to store the data as well as the program instructions. Random Access Memory (RAM) is a type of volatile memory, which is divided into two types: SRAM and DRAM.
Random Access Memory (RAM)
RAM is the short-term memory that is accessed by the processor to execute all the applications. Hence, accessing the RAM is very fast. The embedded system cannot operate without the RAM.
The operation of RAM can be explained with a simple analogy –
Imagine your working table. To do simple mathematics, you will scribble on the paper nearby you without any delay. Once you have finished the work, you will throw the paper in the dustbin.
In the same way, RAM is used in the system.
In earlier days, there are three types of RAM: Static Random Access Memory(SRAM), Dynamic Random Access Memory(DRAM) and Synchronous Dynamic Random Access Memory(RAM).
Static Random Access Memory (SRAM)
It is a type of RAM that uses latching circuitry to store each bit, which is built with flip-flops. Hence the memories need not be refreshed. Thus the data stored will be retained till the duration of power being applied.
The Static Ram has high-speed operation as compared to DRAM and consumes less power. It is also used as cache memory. They are easier to use with low-end microcontrollers. The capacity of SRAM ranges from 1 bit to 256 Megabit. The major disadvantage is that the cost is comparatively higher for SRAM.
SRAMs are manufactured by top manufacturers such as Toshiba, IBM, Intel, Texas Instruments, Hitachi, etc.
Dynamic Random Access Memory (DRAM)
DRAM uses capacitors and transistors to store each bit. The capacitors have a charging and recharging cycle. In order to retain its content, periodic refreshing is to be done and hence called “Dynamic RAM”.
It consumes more power, which generates more heat. DRAM can be packed much denser than SRAM. DRAMs are available at an affordable price.
There are different types of DRAM such as SDRAM, DDR RAM, Graphics DRAM, Video DRAM, etc.,
Synchronous DRAM or SDRAM is a type of DRAM with improved performance. In this, the data transfer is established by synchronizing between the main memory and the microprocessor.
Double Data Rate RAM (DDR RAM) is the most common type available in recent days. It allows multiple data transfers at the same time. There are different versions of DDR RAM such as DDR1, DDR2, DDR3, DDR4 and DDR5. The latest DDR4 RAM has the highest speed of 25 GB per second. DDR5 RAM has a further highest speed of 50 GB per second.
When you buy a laptop or desktop computer system, the type and size of the RAM are the most important specifications. Nowadays, most laptops are equipped with DDR4 RAM. If it is a lower-end model, it is equipped with a size of 4 GB. For higher-end devices, 8 GB or 16 GB memory sizes are preferred.
Non-volatile memory will retain the content when the power applied to the memory device is turned off. Using this memory, the stored data can be retrieved after restarting the system.
The bootup configurations are typically stored in the non-volatile memory. They are slower than volatile memory but more information can be stored for a longer time.
There are different types of non-volatile memory available in the market. All the non-volatile memories can be classified under two categories: Electrically addressed and mechanically addressed.
EPROM, EEPROM, Flash memory belongs to Electrically addressed categories. Disk drive, magnetic tape comes under mechanically addressed categories.
Let us discuss some of the non-volatile memories.
PROM is a programmable Read Only memory made of logic gates. Data can be stored in the PROM by the programmer. It cannot be programmed once the information is written in the device.
EPROM is the Erasable PROM, consisting of floating gate transistors. The information can be stored, erased and also reprogrammed by the end-user. EPROM must be removed from the computer to erase its contents. The stored data can be erased by exposing it to the ultraviolet light source.
EEPROM or E2PROM is an Electrically Erasable PROM. The data can be stored and erased by applying electrical signals. It is not necessary to remove the EEPROM from the computer to erase its content. Large blocks of data can be erased at a time. However, it has a definite lifetime for erasing and reprogramming the data.
Flash memory is a non-volatile electronic memory used in embedded systems. It was invented by Toshiba in 1980, based on EEPROM technology. The stored data in the flash memory can be read much faster than the write operation.
It is an advanced memory technology used in various applications such as mobile phones, computers, PDA, cameras, etc. There are two types of flash memories: NAND and NOR flash memories. They are built from NAND and NOR logic gates.
In NAND type of flash memory, write and read operations are performed page-wise. Whereas the erasing operation is performed blockwise. The NAND memory is generally smaller in size and is used in USB flash drives. Error-correcting code like Hamming code is used in NAND type of flash memory to ensure normal operation.
The read operation in NOR flash memory is similar to that of random access memory. Hence, a faster read operation is possible with NOR than NAND flash memory. It has low storage capacity compared to NAND flash memory.
SD card or Secure Digital Card is a portable flash type non-volatile memory. It has high capacity and high access speed. Hence used for lot of consumer electronics like mobile phones, digital cmeras, etc.,
These cards have its own processor which handles the interface requirements and operations like error correction, etc., They are available in different sizes for diffeent applications. Different variations are available in SD cards such as
- Secure digital High Capacity(SDHC) card
- SD eXtended Capacity (SDXC) card
- SD Ultra Capacity (SDUC) card
So far, we have discussed only a few types of memory. But lot more types of memory are available in real practice such as Masked ROM, NVRAM, VRAM, GRAM, etc., It is always a challenging task to select a perfect memory for an embedded system.
Let us discuss the selection criteria for selecting memory for embedded systems.
Selection of Memory
The selection of suitable memory is a very essential step in designing an embedded system. The designers have to choose the best memory for their system. The selected memory device should reflect the goal of your embedded application.
The performance of the entire embedded system depends on the selection of memory. Improper selection of memory may lead to insufficient memory, slow speed operation, more power consumption, etc. Hence such challenges must be considered while designing an embedded system.
Here we have discussed, some of the factors that should be considered while selecting the memory for an embedded system.
List of Factors
- Speed: The time to read or write the data should be greatest consideration while selecting the memory. In general, speed will not be a greater issue for small embedded applications. But when you go for medium or high range applications, read/write access time time should be faster.
- Latency: It is the time between initiating the request of data until it is received. When executing the processor instructions, it request the data stored in the memory. The requested data must be retrieved by the processor for quick operation. Less latency, then more speed operation.
- Memory Capacity: If your application need below 60 MB, it is advisable to choose the memory size as 64 MB. At the same time, running out of storage is the worst feeling we face with the digital camera. So it is important to choose the capacity as needed for the application.
- Size: The size of the memory device should be compatible withe the embedded system. For hand held devices, the size of the memory should be compact in nature. If it is a desktop computer system, the size can be of medium sized. Proper size selection is also an essential criteria while selecting a memory.
- Power consumption: Memory needs power to read or write data. For high access speed, the power consumptions will be more, results in more power dissipation. More heat will reduce the lifetime of the embedded system. Hence the designers should go with optimum power consumption memory devices.
- Cost: Cost plays a significant role in deciding any product. While planning to design an embedded system, similar importance should be given to memory as that of processor selection. Money should be allocated, considering the type of memory to be used in the embedded system.
Hi Abragam Siyon Sing,
While reading your article you have used the word “overlooked” which means it should be neglected. But the correct correct form will be “Hence such challenges must be taken into consideration while designing an embedded system.”
yeah. you are right, thank you for showing the mistake. It has been corrected now.