4.1 Computer Memory System Overview

COS2621 - Computer Organisation · 4. Cache Memory

Computer Memory System Overview

Introduction to Memory Systems

Computer memory systems are essential for the operation of computers. They store data and instructions for processing. Memory is classified into several types based on speed, size, and volatility. The main types include:

  • Primary Memory: This includes Random Access Memory (RAM) and Read-Only Memory (ROM). It is fast and temporary (RAM) or permanent (ROM).
  • Secondary Memory: This includes hard drives and solid-state drives (SSDs), which provide larger storage but are slower than primary memory.
  • Cache Memory: A small, high-speed storage area that temporarily holds frequently accessed data to speed up processing.

Memory Hierarchy

Memory systems are organized in a hierarchy based on speed and cost. The levels include:

  • Registers: Located inside the CPU, they are the fastest but have limited capacity.
  • Cache Memory: Faster than RAM, it stores copies of frequently accessed data.
  • Main Memory (RAM): Slower than cache but larger in capacity.
  • Secondary Storage: Much slower than RAM but provides large amounts of data storage.

Remember: The speed and cost of memory decrease as you move down the hierarchy.

Volatility of Memory

Memory can be classified as volatile or non-volatile:

  • Volatile Memory: Loses its contents when power is turned off (e.g., RAM).
  • Non-volatile Memory: Retains data even when powered off (e.g., ROM, hard drives).

Memory Access Methods

Data can be accessed in different ways:

  • Random Access: Any memory location can be accessed directly (e.g., RAM).
  • Sequential Access: Data must be accessed in a specific order (e.g., tape drives).

Example of Memory Access

Consider a computer with 16 GB of RAM. When a program requests data, the CPU first checks the cache. If the data is not found (a cache miss), it retrieves it from the RAM. If the data is not in RAM, it will be fetched from the secondary storage. The time taken to access data from each level varies significantly. For example, accessing data from cache may take about 1 nanosecond, while accessing from RAM may take 10 nanoseconds, and from a hard drive may take several milliseconds.

Watch out: Be aware of memory bottlenecks, which occur when the CPU waits for data to be fetched from slower memory.

Summary

  • Memory systems are crucial for data storage and processing.
  • They are organized in a hierarchy from fastest (registers) to slowest (secondary storage).
  • Memory can be volatile or non-volatile, affecting data retention.
  • Access methods vary between random and sequential.

Check your understanding

  • What are the main types of memory in a computer system?
  • Explain the difference between volatile and non-volatile memory.
  • Describe the memory hierarchy and its importance.
  • What is a memory bottleneck, and how can it affect performance?

Test yourself

5 quick questions on this lesson. Pick an answer to see if you're right.

  1. 1. Which memory type is the fastest and is located inside the CPU?

  2. 2. What type of memory is characterized by its ability to retain data even when the power is turned off?

  3. 3. As one goes down the memory hierarchy, the following occur except

  4. 4. What is the main disadvantage of using volatile memory?

  5. 5. Which of the following best describes cache memory?