Unit 3: Computer Memory
Table of Contents
3.1 The Memory Hierarchy
Computer memory is organized in a hierarchy based on speed, cost, and capacity. The goal is to provide a large, fast memory system at an affordable cost.
Rule: The higher up the hierarchy, the faster, smaller, and more expensive (per bit) the memory is.
- Level 1: Registers (Inside the CPU)
- Level 2: Cache Memory
- Level 3: Primary Memory (RAM)
- Level 4: Secondary Memory (Storage)
Cache Memory
A very fast, small amount of memory placed between the CPU and RAM. It stores frequently accessed data and instructions, so the CPU doesn't have to wait for the slower RAM.
3.2 Primary Memory
Also known as Main Memory, this is the computer's "working memory." It is directly accessible by the CPU and holds the OS, programs, and data currently in use.
RAM (Random Access Memory)
This is the main form of primary memory
.- Volatile: Loses all its data when the power is turned off.
- Read/Write: Data can be both read from and written to it.
ROM (Read-Only Memory)
A type of memory where data is pre-recorded. It cannot be easily removed and is usually only read.
- Non-Volatile: Retains its data even when the power is off.
- Use Case: Stores the computer's BIOS or Firmware (the basic instructions needed to start the computer).
3.2 Secondary and Auxiliary Memory
Also known as Storage, this is non-volatile memory used for long-term storage of programs and data
. It is much slower than primary memory but has a much larger capacity.Auxiliary Memory is a term often used for secondary storage, especially removable storage
.Hard Disks
Hard Disk Drives (HDDs) are the most common form of secondary storage. They are magnetic devices that use spinning platters to store data.
Optical Disks
Use lasers to read and write data
. Examples include:- CD (Compact Disc)
- DVD (Digital Versatile Disc)
- Blu-ray Disc
- Primary (RAM): Volatile, Faster, Smaller, Directly accessible by CPU.
- Secondary (HDD): Non-volatile, Slower, Larger, Not directly accessible by CPU (data must be loaded into RAM first).