Sunday, April 12, 2009

Types of Memory

Types of Memory

Many types of software devices are available for use in modern computer systems. Most embedded software developers think of memory as being either Random Access memory ( RAM) or Read Only Memory (ROM). But in fact, there are subtypes of each and even a third class of hybrid memories. In a RAM device, the data stored ar each memory location can be read or written , as desired.














In a ROM device, the data is stored at each memory location can be read as and when required.But we cannot write data to ROM.It needs special techniques. In some cases, its is possible to overwrite the data in ROM device. Such devices are called hybrid memories, because such devices exhibit some of the characeristics of RAM and ROM.
Both RAM and ROM and Radom Access Memories !!!! Justify ??

RAM is called Random Access Memory because writing or reading data from any location of the RAM takes random time. That means its not sequential. In a RAM, writing data to location 0x0000 H and loaction 0xFF56 H takes random amount of time. We cannot say that getting data from 0x0000 H location is faster than 0xFF56. Time taken for writing /reading any location in RAM is random in nature.Thats why RAM is called Random Access Memory.

Likewise, the story is same with ROM also. Time taken to read data any location of ROM is random in nature. Reading data from ROM location 0x0000 h and 0xFF56 h takes random amount of time. So ROM IS ALSO Random Acces Memory.

Types of RAM

RAM can be classified into two types based on the internal design. RAM is divided into SRAM and DRAM.The main difference between them is the lifetime of the data stored. SRAM stands for static RAM. The contents of the SRAM are static in nature unlike DRAM.As long as power is applied , the data is retained in it. The SRAM is made up of flip-flops.Data is retained in internal fil-flops, which dosent requires periodic refreshing.

But in a DRAM( Dynamic RAM ), data is not stored statically, even when the power is applied constantly.This is because in DRAM, data is stored in the Metal Oxide Semiconductor Capacitors (MOS capacitors ). The MOS capacitor cannot store data for a longer period of time. So refreshing the MOS capacitor is necessary, if the data should be retained. So a DRAM controller is needed. The function of DRAM controller is to refresh the DRAM sereval times in a second, so that data can be retained without loss.

When deciding the types of RAM, the hardware designer should take into account both access time and cost. SRAM devices provides exteremely fast access time, but are much expensive than DRAM. SRAM devices are used when communication is to be done extremely fast, such was with a micorcontroller, microprocessor or DSP processor.
In a microprocessor, cache memory is made up of SRAM, because its need to be very fast and should be in synchronization with the processor.

In a PC,the external RAM is made up of DRAM. But its slower than SRAM. In a PC, the memory interfacing order is like this :

Microprocessor Register  L1/L2 cache  DDRAM  Hardisk
High memory cost ---- ---------------- Low memory cost
Access time low -------- ---------------- Access time is high

Types of ROM

Memories in ROM family are distinguished by the metholds used to write a new data to them and the number of times they can be rewritten. A common feature across all these devices is their ability toretain data and programs forever, even during a power failure.

The very first ROMs were hardwired devices, which contained data or instructions. Before production of the RAM, the data and instructions are finalized. So during the process of ROM production, data and instructions are programmed into the device. This is done from factory itself. Such type of ROM devices are called Masked ROM. The main advantages of Masked ROM is their low production cost, but at the cost of flexibility.

The next step in ROM devices is PROM( Programmable ROM). The device is purchased from factory in blank state. Then data can be programmed into the PROM using a special device called device programmer. The device programmer writes data to the device one word at a time, by applying an electrical charge to the input pins of the chip. Once a PROM is programmed in this way, its content can never change. As a result , PROM devices are also called as One Time Programmbale (OTP) devices.
The difference between Masked ROM and PROM/OTP is that PROM is programmed at customer site unlike the masked ROM in factory.

Advancement is technology led to the procution of EPROM, which can be programmed repeatedly in the customer site.No need for factory set up. An EEPROM ( Erasable and Programmable ROM) can classified into two types depending upoon the manner in which devices are programmed. It is classified into UV-PROM ann EEPROM. The UV-PROM ( Ultra- Violet Programmable ROM) is programmed by exposing the device to strong ultra-violet radiation for some period of time.But the disadvantage is that it requires and ultra-violet source. Further one step ahead, EEPROM was made. EEPROM stands for Electrically Erasable PROM, whihc can be programmed using electrical signals. This offers much flexibilty and ease of use when compared to UV-PROM.

Hybrid Types

These devices do not belong to ROM or RAM, but it has got both the properties of RAM and ROM. Hybrid memories can be read and writtern as desired, like RAM, but maintain their contents without electrical power, just like ROM. Two of the hybrid devices are Flash and NVRAM. EEPROM can also be classified under Hybrid types.

Flash memory is the most recent advancements in memory technology. It combines all the best features of the memory devices described so far. Flash memory devices are high density, low cost, non-volatile, fast( can be read fastly,not written) ,and electrically reprogrammable. One of the disadvantage of FLASH memory is that it can be erased or programmed by sector by sector, not word by word as in EEPROM . Typical sector sizes are in the range of 256 bytes to 16 kilobytes. In a microcontroller, the program memory is stored in falsh. So if we want to change the program memory, it should be erased and programmed as a whole. No word by word erasing is not possible.

Another type of hybrid memory is NVRAM( Non-Volatile RAM). An NVRAM is just and SRAM with battery back up. When power is turned on, NVRAM operates just like SRAM. But in the absence of power, NVRAM draws power from the battery back up and retain its contents. NVRAM is very expensive than SRAM and is used to store only few bytes of data like system critical informations. NVRAM is used in real time clocks to preserve the date and time.

No comments: