/ræm/

noun … “Fast, temporary memory for active data.”

RAM (Random Access Memory) is a type of volatile memory that provides fast, temporary storage for data and instructions currently in use by a CPU. Unlike non-volatile memory such as Flash or ROM, the contents of RAM are lost when power is removed. RAM is critical for system performance because it allows rapid read and write operations, supporting multitasking, buffering, and caching.

Key characteristics of RAM include:

  • Volatility: data is cleared when power is off.
  • Random access: any memory location can be read or written in constant time.
  • Speed: significantly faster than most storage devices.
  • Types: includes DRAM (Dynamic RAM), SRAM (Static RAM), and specialized forms like VRAM for graphics.
  • Integration: directly connected to the CPU for rapid data access and execution.

Workflow example: Accessing RAM in a program:

int buffer[5] = {1, 2, 3, 4, 5}   -- Stored in RAM
buffer[2] = 10                       -- Modify third element directly
sum = 0
for int i = 0..4:
    sum += buffer[i]                 -- Read elements from RAM

Here, the buffer array resides in RAM, allowing the CPU to read and write elements quickly, illustrating temporary active storage.

Conceptually, RAM is like a desk where you place documents you are currently working on: items are quickly accessible, but they vanish if you leave the desk without filing them elsewhere.

See Memory, CPU, Cache, DRAM, SRAM.