Types of Memory

Prior Knowledge: Key Terms & Concepts

  • Read: Signifies that a component (such as a memory chip) can be read off of. In this context, the component contains information that can be accessed.
  • Write: Signifies that a component (such as a memory chip) can be written to. In this context, the component can be sent information to store, likely to be "read" later.
  • Volatile: If a form of data storage is "volatile" that means its information is lost when power is no longer being supplied. Volatile memory systems need a constant supply of power (sometimes thousands of pulses per second). For example, if you power down your computer volatile forms of memory would be wiped. Conversely, "non-volatile" forms of memory are stable even when the computer is turned off. (Source: https://techterms.com/definition/nand)
  • Binary: A computer's form of logic and how information is carried in processors, memory, and long-term storage. Binary is represented as 1s and 0s, which also are communicated as "on" and "off", "closed" and "open", or "true" and "false" (this latter use is called boolean logic), respectively.
  • Transistor: A semiconductor device used to switch on and off electrical signals. Transistors use external charges to open or close gates that can selectively allow a current to pass. They are extremely useful for logic tasks and storing memory and are the backbone of modern computers.
  • Logic gate: A gate, usually created with a transistor, that has two boolean logic inputs ("true" or "false" for each) and one logical output. Examples of some logic gates include AND gates, where both inputs have to be true for the output to be true, and OR gates, where one input has to be true for the output to be true. Modern CPUs use millions of these logic gates to perform complex calculations. (Source: http://www.pages.drexel.edu/~jak384/tutorial-1-3.html)
  • NAND: Stands for "NOT AND". NAND is a type of logic gate that produces a "false" output only if both inputs are "true". Otherewise, it returns "false". NAND gates are commonly used in flash memory as they have fast read / write times. (Source: https://techterms.com/definition/nand)
  • Flash: A form of non-volatile data storage that has quick read and write access. The two major subgroups of flash storage are NAND-based and NOR-based, which are two forms of logic gate architectures. NOR-based flash memory can read faster, however NAND-based flash can write faster and can store more information. Flash memory was developed from a type of ROM memory, which is explained in further detail below. Although flash can be used in SSDs as a form of long-term memory storage, it is not nearly as fast as RAM. (Source: https://www.netapp.com/us/info/what-is-flash-storage.aspx)
  • Lanes: Think of these as lanes on a highway or underground pipes transporting water. If you want to transport more water, you can either add more pipes or use advanced materials that can handle faster-moving water. In computers, lanes transport data in bits between components. Components that need a high speed, low-latency connection to one another often use more lanes and are in close proximity.

Types of Memory

Figure 1: Common appearance of RAM

Source: https://en.wikipedia.org/wiki/Random-access_memory

Random-Access Memory (RAM)

Random access memory, or "RAM", can be thought of as a computer's short-term memory. It stores data from a computer's operating system and applications that are currently in use, and is capabale of quickly retrieving the imformation. One attribute of RAM that differentiates it from longer-term storage is that it is "voltatile". This means that when the computer is powered down, the information stored in RAM dissapears.

RAM is advantageous to other information storage options because it can quickly store and retrieve information. Each location within a RAM chip has an "address" which can be directly called from the central processing unit (CPU). The more tasks that are occuring at one given time on your computer, the more full the RAM will be. This is different from the computer's long-term storage, which does not fill up or empty depending on the amount of applications open.

There are different sub-types of RAM, the main two being static RAM and dynamic RAM. Dynamic RAM uses transistors to act as gates that allow capacitors to be charged or discharged. The capacitor's charge (or lackthereof) indicates a 1 or a 0 in binary. Static RAM uses multiple transistors to act as a switch at one location in memory, instead of using the transistor as a gate to a capacitor. The multiple transistors required to store one bit of information make static RAM chips less "dense" for storage capacity, but they do not have the same energy requirements as dynamic RAM. Because the capacitors in dynamic RAM leak over time, they need to be constantly refreshed with a charge (thousands of times per second) and subsequently use more power.

(Source: https://searchstorage.techtarget.com/definition/RAM-random-access-memory)
Figure 2: Stereotypical ROMSource:https://bmet.fandom.com/wiki/Electrically_Erasable_Programmable_Read-Only_Memory

Read-Only Memory (ROM)

Read only memory is different from RAM in that it cannot be written to or altered ("read only"). This makes ROM non-volatile, as it does not need a constant supply of power to open or close gates to alter memory information. When the computer or device is powered down, ROM still retains its data. Given this advantage, ROM is used for boot-up programs, devices like the nintendo DS slide-in games, bootloader software, and default applications.

Because ROM is non-volatile yet has read-only access, you may be wondering why computers don't just use the computer's long-term storage. ROM is used in certain scenarios over the computer's hard drive because, like RAM, it can be very rapidly accesed. For programs that need data quickly, this is a significant advantage over conventional long-term storage options.

(Source: https://searchstorage.techtarget.com/definition/RAM-random-access-memory)

RAM

ROM

Advantages

  1. Read and write functionality, unlike ROM.
  2. Flexible use cases, such as on-demand storage
  1. Non-voltatile, so it can retain information in the absence of power
  2. Does not "leak" the same way RAM does. Very stable memory storage over long periods of time

Applications

  1. Acts as the "working memory" or short-term memory for most portable electronics
  2. Can perform operations on data retrieved from long-term storage
  1. Boot-up software
  2. Recovery mode software
  3. Gameboy insertable cartridges

Types of Storage

Figure 3: Magnetic storage disk used in computersSource: https://en.wikipedia.org/wiki/Magnetic_storage

Magnetic Storage

Magnetic storage refers to any type of long-term data storage that uses magnetic polarity to store binary information. For example, magnets can either be positive or negative, and these two polarities can be used to store the 1s and 0s computers need to encode information. Some types of magnetic storage are magnetic tape, floppy disks, and disk drives.

(Source: https://study.com/academy/lesson/magnetic-storage-definition-devices-examples.html)

Before the emergence of high-performance and cost-effective solid state drives, magnetic storage (usually a disk drive or "HDD") was the major form of long-term data storage in the hard drives of computers. Magnetic tape is used in the VCR movies we watched as kids. Magnetic storage is a form of non-volatile storage, as the information is not lost when the computer powers down.

(Source: https://study.com/academy/lesson/magnetic-storage-definition-devices-examples.html)

Magnetic storage works by allocating locations on a disk or tape that are magnetically charged to indicate a 1 or a 0. A physical device called a magnetic head must navigate the tape or disk to that particular location to read and write the charges. This is why the disk drives spin and the tapes are wound up, because the magnetic head must find a particular point on the storage medium to access and store data. This physical motion leads to magnetic storage being an extremely energy, noise, thermal, and space inefficient method of storage. A general rule in engineering is to have as few moving parts as possible so as to avoid breakdown over time. Solid state drives, which we will get to in the next section, have this advantage as they are generally much more reliable over time and rarely require service.

(Source: https://study.com/academy/lesson/magnetic-storage-definition-devices-examples.html)

Another disadvantage of magnetic storage is the slow access to data. As the disk or tape spins, the tip which reads and writes the information has to sequentially navigate large physical areas to find a particular memory address. This means when you want to access a particular file or application, the hard drive cannot go directly to that address. It has to navigate from a to b, b to c, and so on until it finds what you are referencing. This can lead to incredibly large latencies when accessing and storing information relative to RAM and SSD.

(Source: https://study.com/academy/lesson/magnetic-storage-definition-devices-examples.html)
Figure 4: Internal appearance of a SSD. Notice how there are no moving componentsSource: http://naveenkapil.in/blog/determine-type-hard-drive-hdd-ssd/

Solid-State Drives (SSD)

Solid state drives are a form of non-volatile data storage that do not require mechanical motion to operate ("solid state"). SSDs usually utilize NAND-type flash storage for the organization of transistors. NAND logic gates are organized into individual memory addresses which are arranged into "grids" that comprise larger "blocks". Like RAM and unlike magnetic drives, these memory locations have a specific address that can be directly navigated to by the CPU.

(Source: https://www.crucial.com/articles/about-ssd/ssd-vs-hdd)

The difference between the flash storage used in SSDs and the transistor layouts used in RAM is that flash storage uses floating-gate transistors to permantently store a charge or lackthereof. These floating gate transistors do not require a constant supply of power to maintain their "on" and "off" positions as they store the charge from a transistor in a barrier of silicon which prevents energy leakage. This design allows SSDs to store data even when the computer powers down.

(Source: https://www.crucial.com/articles/about-ssd/ssd-vs-hdd)

The flash storage used in SSDs was developed from EEPROM (electronically erasable programmable read-only memory) and shares many of the same structural and functional characteristics. For example, both flash and EEPROM can maintain memory in the absence of charge cycles (non-volatile) and data can read and write at high speeds.

(Source: https://www.arrow.com/en/research-and-events/articles/computer-memory-types-explained-flash-ssd-ram-eeprom-hdd)

A question you may have is, if SSDs can read and write data at specific addresses and retain the information without power, why use RAM at all instead of the SSD? Information stored in RAM can be accessed much quicker than data stored in an SSD. Although SSDs can read and write data to specific addresses in storage far quicker than magnetic drives can, RAM still outperforms them. This is due to many reasons, such as how SSDs manipulate stored information on blocks as well as how individual gates in transistors are organized to store binary data.

(Source: https://www.crucial.com/articles/about-ssd/ssd-vs-hdd)

Compared to magnetic disks, SSDs provide a lot of advantages. Because there are no moving parts, SSDs require far less energy and cooling to operate. They also can access and update information faster. They are generally lighter, less prone to malfunction, and degrade at a slower rate over time. At the same time, there are some drawbacks to consider. SSDs are usually more expensive per GB than disk drives and require additional storage capacity than what is accessible to the user due to the way they write data.

(Source: https://www.crucial.com/articles/about-ssd/ssd-vs-hdd)

Magnetic Storage

Solid-State Drives

Advantages

  1. Lower cost
  2. Higher ceiling for storage capacity, although this is rapidly becoming obsolete.
  1. Much faster access to stored information
  2. More noise and energy efficient
  3. Can withstand mechanical shocks such as drops

Applications

  1. VCR tapes (retro!)
  2. Hard disk drives for storage in computers
  1. Non-volatile long-term storage in computers
  2. USB thumb-drives

Putting It All Together

A common theme you may notice is that memory and storage use different technologies yet effectively accomplish the same thing: storing bits of information. With that in mind, lets put them side-by-side and see how they stack up.

Rambus.com made a great illustration which can be seen in figure 5 below. The pyramid shows how despite being separated into two distinct sections, memory and storage lie on the same spectrum. The CPU has immediate access to sRAM and cache, which are used for nanosecond-latency data transfers. SSDs on the other hand have a latency measured in microseconds (1 microsecond = 1,000 nanoseconds) and HDD latencies are measured in milliseconds. DRAM, or what we often refer to as "RAM", is often located closer to the CPU and is connected with more lanes when compared to the SSD.

The general rule here is that increased speed is associated with higher costs and decreased maximum capacities.

Figure 5: Comparing different types of storing dataSource: https://www.rambus.com/blogs/mid-when-memory-and-storage-converge/

All of these components, however, use different architectures that allow them to serve different functions. The figure below from webopedia.com illustrates how all components come together to operate a computer.

Input from the user (such as a keystroke or opening an application) enters the CPU from the left. The control unit (CU) in the CPU commands the other components and serves as a central hub for information, although all of these components usually have direct lanes to one another. The CU communicates directly with the memory unit (cache for rapid access and RAM for larger tasks) to pull necessary information and perform calculations. Depending on the task, the memory unit will read from and write to storage. The control unit completes the calculation and pushes it to the output, which usually continues on to other components in the computer such as the display or ethernet port.

Figure 6: How RAM, ROM, and long-term storage come together in a computerSource: https://www.webopedia.com/TERM/C/CPU.html

References