NotesA LevelComputer Sciencememory ram rom cache
Back to Computer Science Notes

memory ram rom cache

A LevelComputer Science~6 min read

Overview

# Memory: RAM, ROM and Cache - Summary This lesson covers the three primary types of computer memory and their distinct functions within the von Neumann architecture. Students learn that RAM (Random Access Memory) is volatile, high-capacity memory for temporary data storage during program execution; ROM (Read-Only Memory) is non-volatile memory storing permanent instructions like BIOS; and cache memory is extremely fast, small-capacity memory that reduces CPU-RAM access time by storing frequently used instructions. Understanding the hierarchy, characteristics (volatility, speed, capacity, cost), and practical applications of each memory type is essential for exam questions on system architecture, performance optimization, and the fetch-execute cycle.

Core Concepts & Theory

Memory forms the crucial data storage hierarchy in computer systems, with three primary types serving distinct purposes.

RAM (Random Access Memory) is volatile memory that temporarily stores data and instructions currently in use. Cambridge defines volatility as the property where memory contents are lost when power is removed. RAM provides fast read/write access to any location (hence 'random access') and acts as the computer's working space. Modern systems use DRAM (Dynamic RAM), requiring constant refreshing, or SRAM (Static RAM), which is faster but more expensive.

ROM (Read-Only Memory) is non-volatile memory containing permanent instructions that cannot be easily modified. The BIOS (Basic Input/Output System) or UEFI firmware resides in ROM, providing boot-up instructions and hardware initialization routines. Types include:

  • PROM: Programmable once
  • EPROM: Erasable via UV light
  • EEPROM/Flash: Electrically erasable and reprogrammable

Cache Memory is extremely fast, expensive memory positioned between the CPU and RAM to reduce the von Neumann bottleneck. It exploits the principle of locality:

  • Temporal locality: Recently accessed data will likely be accessed again soon
  • Spatial locality: Data near recently accessed locations will likely be needed

Cache operates in levels: L1 (smallest, fastest, on-chip), L2 (larger, slightly slower), and L3 (largest, shared between cores). The cache hit ratio measures effectiveness:

Hit Ratio = (Cache Hits) / (Total Memory Accesses)

Cambridge Key Point: Memory hierarchy balances speed, cost, and capacity - faster memory is more expensive per byte, requiring strategic organization.

Detailed Explanation with Real-World Examples

Think of memory hierarchy as a library system analogy: ROM is like reference books permanently kept behind the desk (rarely changed, always available), RAM is your study desk with books you're actively using (cleared when you leave), and cache is like keeping your most-used textbook open right in front of you.

Real-World RAM Applications: When you open a web browser, the application code loads from the hard drive into RAM. As you open multiple tabs, each webpage's content, images, and JavaScript occupy RAM space. If you have 8GB RAM and open too many tabs, the system begins paging - swapping data between RAM and slower storage, causing noticeable slowdown. Modern smartphones manage RAM aggressively, closing background apps to prevent this.

ROM in Everyday Devices: Your smartphone's ROM stores the bootloader that initializes the device when you press the power button. In embedded systems like washing machines, ROM contains the control program for different wash cycles. Gaming consoles use ROM cartridges (historically) to store unchangeable game code, ensuring consistency across millions of copies.

Cache in Action: Consider video editing: when scrubbing through a timeline, the CPU repeatedly accesses the same video frames. Cache stores recently viewed frames, providing instant access rather than fetching from RAM each time. This explains why the second playthrough of a video section feels smoother - temporal locality in action!

CPU Performance Impact: Intel's i9 processors include up to 36MB L3 cache, while budget processors have 4-6MB. In gaming benchmarks, this difference can mean 10-15% performance variation in CPU-intensive titles, demonstrating cache's critical role in modern computing performance.

Worked Examples & Step-by-Step Solutions

**Example 1: Cache Performance Calculation** *Question*: A CPU makes 10,000 memory accesses. 8,500 are found in cache (hits), while 1,500 require RAM access (misses). Calculate the hit ratio and explain the performance implications. *Solution*: Hit Ratio = Cache Hits / Total Accesses = 8,500 / 10,...

Unlock 3 More Sections

Sign up free to access the complete notes, key concepts, and exam tips for this topic.

No credit card required · Free forever

Key Concepts

  • RAM (Random Access Memory): Volatile memory used for temporary storage of data and program instructions currently being used by the CPU.
  • ROM (Read Only Memory): Non-volatile memory containing essential boot-up instructions and firmware that cannot be easily altered.
  • Cache Memory: Small, very fast memory located close to the CPU, used to store frequently accessed data and instructions for quicker retrieval.
  • Volatile Memory: Memory that loses its contents when power is removed.
  • +3 more (sign up to view)

Exam Tips

  • Clearly differentiate between **volatile** and **non-volatile** memory, providing examples for each (RAM is volatile, ROM is non-volatile).
  • Explain the **purpose and function** of each memory type (RAM for active data, ROM for boot-up, Cache for speed optimisation).
  • +3 more tips (sign up)

AI Tutor

Get instant AI-powered explanations for any concept in this topic.

Still Struggling?

Get 1-on-1 help from an expert A Level tutor.

More Computer Science Notes

Ask Aria anything!

Your AI academic advisor