Electronic – Differences, uses, and theory of volatile and nonvolatile memory

computer-architecturememorynon-volatile-memoryram

I understand the basics of volatile and nonvolatile memory. Volatile memory requires a constant power supply to retain data whereas non-volatile memory does not require a constant power supply to retain data. What I would like to know is this: are there any other major differences in terms of performance, speed, size etc? In addition, what uses do each play in a computer? Lastly, how does each work? Thanks in advance for all answers and comments.

Best Answer

Yes, you understand the definition of volatile and non-volatile memory. From that alone you'd think non-volatile is always better. However, in the real world that is not true since the different technologies for making these memories cause other attributes to appear beyond volatileness.

Tradeoffs that various different memory technologies force on us include:

  1. Read speed.

  2. Write speed.

  3. Cost.

  4. Size.

  5. Power consuption when idle, reading, and writing.

  6. Operating lifetime.

  7. Number of lifetime reads or writes.

and that's just what came to mind quickly. Obviously, the ideal memory is fast to read, fast to write, costs little, is small, takes little power, lasts a long time, and can be used many times. There is no one technology that does a good job in all these areas together. Volatileness is just one more entry in the list of parameters to consider.

In something like a microcontroller intended to be embedded into a circuit that needs to turn on quickly, having the main program memory be non-volatile is imortant. That today generally means it will be slow to write, have a finite number of lifetime writes, and will forget its content after a few 10s of years. Obviously we'd like to not have these drawbacks, but nobody knows how to make a memory that doesn't have them for the size and cost required in a micro.

The data memory in a micro could be arbitrarily written and read in a loop millions of times in seconds, possibly going on for years, so a technology that doesn't have a finite number of lifetime reads or writes is important. To get that, we give up the ability to retain the values when power is removed.

There are all kinds of memory technologies that optimize some of these parameter, inevitably at the expense of others. Some common technologies:

  • CMOS static RAM. These are really logic circuits optimized to hold bits. They are fast, have effectively infinite lifetime reads and writes, take little power when not being accessed, and have a long operating lifetime. On the other hand, this memory is volatile, and the cells are relatively large, which makes them expensive with high densities not attainable.

  • EEPROM. Actually that's not strictly speaking a technology, but today (this could easily change) these memories are commonly implemented with floating gate MOSFETs. Their main attribute is that they are non-volatile. Density is high, so cost is low, but they get physically worn out a little bit every time the charge on the gate is changed, which is what writing or erasing does.