knowledge

Overview

Memory architecture defines how data is stored, accessed, and managed across different types of memory in a computer system. It directly impacts system performance, latency, and data throughput.


Terminology

TermDefinition
LatencyTime between a request and data delivery
Throughput (Bandwidth)Rate of data transfer (bits per second)
BufferingTemporary storage of data during transfer
Cache HitData found in cache; no need to access main memory
Cache MissData not in cache; must be fetched from main memory
Temporal LocalityRecently accessed data is likely to be reused
Spatial LocalityData near recently accessed locations is likely accessed next

Core Concepts

Memory Hierarchy

Memory types are organized by speed, cost, and volatility. More volatile = faster but loses data without power.

LevelTypeVolatile?
1RegistersYes
2CacheYes
3RAMYes
4ROMNo
5Secondary Storage (HDD/SSD)No
6External Storage (USB, Optical, Tape)No

RAM vs ROM

FeatureRAMROM
VolatilityVolatileNon-volatile
SpeedFast read/writeSlower writes
UseActive processesFirmware storage

SRAM vs DRAM

FeatureSRAMDRAM
SpeedFasterSlower
CostMore expensiveCheaper
Refresh RequiredNoYes
UseCache memoryMain system memory

Types of ROM

TypeDescription
PROMProgrammable once
EPROMErased with UV light; must be physically removed
EEPROMElectrically erasable; reprogrammable in-circuit

Cache Memory

High-speed memory sitting between the CPU and RAM that reduces access time to frequently used data.

  • Cache Hit – Data found in cache; fast retrieval
  • Cache Miss – Data not in cache; fetched from main memory
  • Temporal Locality – Recently accessed data is reused soon
  • Spatial Locality – Nearby data is likely accessed together

Disk Performance Metrics

  • Seek Time – Time to move read/write head to correct track
  • Rotational Latency – Time for sector to rotate under the head
  • Transfer Time – Time to read/write the data
  • Spin-Up Time – Time for disk to reach operating speed

Disk Access Time = Seek Time + Rotational Latency + Transfer Time (+ Spin-Up if starting)

Secondary Storage

Hard Disk Drives (HDD)

  • Magnetic storage with spinning platters
  • Mechanical components → slower but cheaper
StructureDescription
TracksConcentric circles on a platter
SectorsSmallest unit (typically 512B or 4KB)
ClustersGroups of sectors

Solid State Drives (SSD)

  • No moving parts; uses flash memory
  • Faster and more reliable than HDDs

RAID (Redundant Array of Independent Disks)

Combines multiple drives for performance and/or redundancy.

RAID LevelStrategyFault Tolerance
RAID 0StripingNone
RAID 1Mirroring1 drive
RAID 5Striping + Parity1 drive
RAID 6Double Parity2 drives
RAID 10Mirroring + Striping1 per mirror pair

External Storage

Storage outside the main system — major attack vector, especially in air-gapped environments.

TypeDescription
Magnetic TapeSequential access, low cost, archival use
Optical MediaCD/DVD/Blu-ray; laser-based storage
SD Cards / Flash MediaSolid-state portable storage
⚠︎Security Note

Physical media is a significant attack vector. A U.S. military breach was caused by an infected USB device that spread malware across classified networks.



References / Images

  • Memory hierarchy diagram
  • Cache structure visuals
  • RAID layout diagrams