Computer Memory Notes: RAM, ROM, Cache
Komal Gupta
UPSC Exam Expert & Content Editor
In this note
- 1.Quick Facts at a Glance
- 2.1. The Memory Hierarchy
- 3.2. RAM (Random Access Memory)
- 4.3. ROM (Read Only Memory)
- 5.4. RAM vs ROM
- 6.5. Cache Memory and Registers
- 7.6. Virtual Memory
- 8.7. Secondary Storage Devices
- 9.8. Memory Units
- 10.9. Memory in Everyday Devices
- 11.10. Sequential and Direct Access
- 12.11. Practice Questions
- 13.Related Notes
- 14.Frequently Asked Questions
PDF Notes: Computer Memory Notes: RAM, ROM, Cache
Premium PDF · one-time payment of ₹5 · instant access
Memory is the part of a computer that stores data and instructions, either temporarily while work is being done or permanently for later use. Without memory, a computer could not hold the program it is running, the document you are typing or the photos on your phone. Questions on memory are among the most frequent in the computer awareness sections of IBPS PO, Clerk, SBI, RRB and insurance exams, and they also appear in SSC, railway and state exams. Common questions ask about the difference between RAM and ROM, types of ROM, cache memory, the memory hierarchy and memory units such as kilobytes and gigabytes. This note explains each concept in simple language with examples from everyday devices.
Quick Facts at a Glance
- Primary memory (main memory) is directly accessed by the CPU: RAM, ROM and cache.
- Secondary memory stores data permanently: hard disks, SSDs, pen drives, CDs and DVDs.
- RAM is volatile: it loses data when power is switched off. ROM is non-volatile: it keeps data without power.
- Fastest memory: CPU registers, followed by cache memory.
- Smallest unit of data: Bit (0 or 1). 8 bits = 1 byte.
1. The Memory Hierarchy
Computers use several types of memory arranged in a hierarchy. As we move from the top to the bottom, memory becomes larger, cheaper per byte and slower.
| Level | Memory | Speed | Capacity |
|---|---|---|---|
| 1 | CPU registers | Fastest | Very small (bytes) |
| 2 | Cache memory (L1, L2, L3) | Very fast | Kilobytes to megabytes |
| 3 | Main memory (RAM) | Fast | Gigabytes |
| 4 | Secondary storage (SSD, HDD) | Slower | Hundreds of gigabytes to terabytes |
| 5 | Tertiary / backup storage (tape, optical discs, cloud archives) | Slowest | Very large |
The idea is simple: keep the data the CPU needs right now in the fastest memory, and keep everything else in cheaper, larger storage. This balance gives good performance at a reasonable cost.
2. RAM (Random Access Memory)
RAM is the computer's working memory. When you open a program or a file, it is loaded from the hard disk or SSD into RAM, because the CPU can read RAM much faster. RAM is called "random access" because any location can be reached directly in the same time, unlike a tape where you must move through data in order.
- RAM is volatile: all data is lost when the computer is turned off. That is why unsaved work disappears during a power cut.
- More RAM allows more programs and larger files to be open at once without slowing down.
Types of RAM
| Feature | SRAM (Static RAM) | DRAM (Dynamic RAM) |
|---|---|---|
| Construction | Flip-flops (several transistors per bit) | One transistor and one capacitor per bit |
| Refreshing | Not needed while power is on | Must be refreshed thousands of times per second |
| Speed | Faster | Slower |
| Cost and size | Expensive, larger per bit | Cheaper, denser |
| Use | Cache memory | Main memory (system RAM) |
Modern main memory uses SDRAM (Synchronous DRAM) in its DDR (Double Data Rate) forms such as DDR4 and DDR5, which transfer data on both the rising and falling edges of the clock signal.
3. ROM (Read Only Memory)
ROM is non-volatile memory that stores permanent instructions needed to start the computer. The most important example is the firmware (BIOS or its modern replacement, UEFI), which runs the Power-On Self-Test (POST) and starts the boot process that loads the operating system.
Types of ROM
- Masked ROM (MROM): Data is written during manufacturing and cannot be changed.
- PROM (Programmable ROM): Blank when made; can be programmed once by the user with a special device. After that, it cannot be changed.
- EPROM (Erasable PROM): Can be erased by exposing it to ultraviolet light through a small window, and then reprogrammed.
- EEPROM (Electrically Erasable PROM): Can be erased and rewritten electrically, byte by byte, without removing it from the circuit.
- Flash memory: A type of EEPROM that erases data in blocks, making it faster. It is used in pen drives, memory cards, SSDs and smartphone storage.
4. RAM vs ROM
| Basis | RAM | ROM |
|---|---|---|
| Volatility | Volatile | Non-volatile |
| Read / write | Read and write | Mainly read (some types can be rewritten) |
| Purpose | Temporary storage of running programs and data | Permanent storage of startup instructions (firmware) |
| Speed | Faster | Slower than RAM |
| Capacity in a PC | Several gigabytes | Usually a few megabytes |
5. Cache Memory and Registers
Cache memory is a small, very fast memory, made of SRAM, that sits between the CPU and RAM. It stores copies of data and instructions the CPU is likely to use again soon. When the CPU finds what it needs in the cache (a cache hit), work speeds up; when it does not (a cache miss), it must fetch from slower RAM. Modern processors have several levels: L1 (smallest and fastest, inside each core), L2 (larger) and L3 (shared among cores).
Registers are the smallest and fastest storage locations, located inside the CPU itself. They hold the data and instructions being processed at that moment. Examples include the accumulator, the program counter (which holds the address of the next instruction) and the instruction register.
6. Virtual Memory
When RAM is full, the operating system uses part of the hard disk or SSD as if it were extra RAM. This is called virtual memory, and the area on disk is called the page file or swap space. It allows more programs to run than physical RAM alone would allow, but it is much slower, which is why a computer with too little RAM feels sluggish.
7. Secondary Storage Devices
- Hard Disk Drive (HDD): Stores data magnetically on spinning platters; large capacity and low cost, but slower and has moving parts.
- Solid State Drive (SSD): Uses flash memory with no moving parts; much faster, quieter and more durable, though costlier per gigabyte.
- Optical discs: CD (about 700 MB), DVD (about 4.7 GB single layer) and Blu-ray (about 25 GB single layer), read using lasers.
- USB flash drives and memory cards: Portable flash storage.
- Magnetic tape: Sequential access; still used for large, low-cost backups.
- Cloud storage: Data stored on remote servers and accessed over the Internet, such as Google Drive or DigiLocker.
8. Memory Units
| Unit | Equal to |
|---|---|
| 1 Nibble | 4 bits |
| 1 Byte | 8 bits |
| 1 Kilobyte (KB) | 1,024 bytes |
| 1 Megabyte (MB) | 1,024 KB |
| 1 Gigabyte (GB) | 1,024 MB |
| 1 Terabyte (TB) | 1,024 GB |
| 1 Petabyte (PB) | 1,024 TB |
| 1 Exabyte (EB) | 1,024 PB |
| 1 Zettabyte (ZB) | 1,024 EB |
| 1 Yottabyte (YB) | 1,024 ZB |
Memory trick for the order: K-M-G-T-P-E-Z-Y ("King Mahesh Got Ten Pens, Each Zero Yellow").
9. Memory in Everyday Devices
Understanding memory becomes easier when you connect it with devices you use daily. When a smartphone is advertised as "8 GB + 256 GB", the first number is the RAM (working memory for running apps) and the second is the internal storage (flash memory for apps, photos and files). If you open many apps and the phone slows down, RAM is running short; if you cannot save new photos, storage is full. A laptop with 16 GB RAM and a 512 GB SSD will usually feel faster than one with 8 GB RAM and a 1 TB HDD, because both more RAM and an SSD reduce waiting time. When you restart a phone, apps reload from storage into RAM, which is why the first launch after a restart is slower.
10. Sequential and Direct Access
Storage devices also differ in how they reach data. Sequential access means data must be read in order, like a cassette tape or magnetic tape. Direct (random) access means any location can be reached directly, as in RAM, hard disks, SSDs and optical discs. This is why tape is used mainly for archives and backups, where speed of access is less important than low cost and large capacity.
11. Practice Questions
- Which memory holds the address of the next instruction to be executed? Answer: The program counter register.
- Which memory is used in pen drives? Answer: Flash memory.
- BIOS is stored in which type of memory? Answer: ROM (typically flash-based firmware).
- What is a nibble? Answer: 4 bits.
- Which storage device has no moving parts? Answer: SSD.
Exam tip: If a question asks which memory is "volatile", choose RAM or cache; if it asks which is "non-volatile", choose ROM, flash, HDD or SSD. If it asks which is "closest to the CPU", choose registers.
Related Notes
- Computer Basics: Hardware and Software
- Operating System, Database and Programming Basics
- Computer Abbreviations and Full Forms
- All Computer Knowledge Notes
Frequently Asked Questions
What is the difference between RAM and ROM?
RAM is volatile read-write memory used for running programs; ROM is non-volatile memory that stores permanent startup instructions.
Which memory is the fastest?
CPU registers are the fastest, followed by cache memory.
What is cache memory?
A small, very fast memory between the CPU and RAM that stores frequently used data and instructions.
Which type of RAM is used in cache memory?
SRAM (Static RAM).
Which type of RAM needs refreshing?
DRAM (Dynamic RAM) must be refreshed constantly.
How is EPROM erased?
By exposing it to ultraviolet light.
How is EEPROM erased?
Electrically, without removing it from the circuit.
What is virtual memory?
A technique in which the operating system uses part of the disk as temporary extra RAM.
Is RAM volatile?
Yes. RAM loses its data when power is switched off.
How many bits make a byte?
Eight bits make one byte.
How many bytes are in a kilobyte?
1,024 bytes in the binary convention used in computer exams.
What is the difference between HDD and SSD?
An HDD stores data magnetically on spinning disks; an SSD uses flash memory with no moving parts and is much faster.
Previous chapter
Types of Computers and Supercomputers in India
Next chapter
Input and Output Devices of Computer
Komal Gupta
UPSC Exam Expert & Content Editor
Komal is a senior UPSC exam strategist with 8+ years of experience helping aspirants crack CSE, CDS and NDA exams. She writes in-depth notification breakdowns, exam pattern guides and preparation strategies.