Skip to content
Topic 02 8 min read

Memory, Storage & Peripherals

Memory and Storage Devices

Memory and storage form a hierarchy from CPU registers to tape. Speed and cost per bit rise as capacity falls, so cache and virtual memory keep active data close to the processor. SRAM and DRAM serve cache and main memory; ROM and flash hold firmware and files; magnetic, optical and solid-state media provide nonvolatile secondary storage. Peripherals connect through interfaces whose bandwidth must match the device.

01

Memory hierarchy

Levels closer to the CPU are faster, smaller and more expensive per bit. Levels farther away are slower, larger and cheaper per bit.

  • Registers: fastest and smallest level, inside the CPU, holding operands and addresses.
  • Cache (L1, L2, L3): SRAM buffer for recently used blocks, sized from kilobytes to megabytes.
  • Main memory: DRAM holding active programs and data, typically 8-64 GB.
  • SSD: nonvolatile NAND flash storage, typically 256 GB-4 TB.
  • HDD: magnetic disks with terabyte capacity and millisecond access.
  • Tape: lowest cost per byte, sequential access, used for archives and backups.
Memory hierarchy: speed, cost and volatility
LevelTypical sizeTypical latencyRelative cost per bitVolatile?
RegistersUnder 1 KBUnder 1 nsHighestYes
L1/L2/L3 cache32 KB-32 MB1-15 nsVery highYes
Main memory (DRAM)8-64 GB60-100 nsModerateYes
SSD (NAND flash)256 GB-4 TB0.05-0.1 msLowNo
Hard disk1-20 TB5-10 msVery lowNo
Magnetic tapeMany TBSeconds-minutesLowestNo
02

SRAM and DRAM

Both are volatile random-access memories, but they store a bit differently. SRAM uses flip-flops; DRAM uses capacitors.

  • SRAM stores a bit in a flip-flop made from about six transistors.
  • SRAM needs no refresh and is fast, but each cell is large and costly.
  • SRAM is used for CPU cache, not for main memory.
  • DRAM stores a bit as charge on a capacitor with one transistor.
  • DRAM capacitors leak, so rows are refreshed every 64 ms in a typical chip.
  • DRAM is denser and cheaper per bit than SRAM, but slower and refresh-dependent.
  • Both SRAM and DRAM lose their contents when power is removed.
03

ROM family

ROM is nonvolatile and retains its contents without power. The family differs in how it is written and erased.

  • Mask ROM is programmed during manufacture and cannot be changed.
  • PROM is blank when sold and written once by blowing fuses in a programmer.
  • EPROM is erased by ultraviolet light through a quartz window, typically for 15-30 minutes.
  • EEPROM is erased and rewritten electrically, byte by byte.
  • Flash is EEPROM-based and erases in blocks; it is used in SSDs, USB drives and phones.
  • ROM commonly holds firmware such as the boot program.
RAM versus ROM
PropertyRAMROM
VolatilityVolatile; loses data on power lossNonvolatile; keeps data without power
WritesRead and written during normal operationWritten once or infrequently
Typical useMain memory and cacheFirmware and boot code
ExamplesSRAM, DRAMMask ROM, PROM, EPROM, EEPROM, flash
04

Cache and virtual memory

Cache exploits locality by keeping recent blocks close to the CPU. Virtual memory maps each program to physical frames and can spill pages to storage.

  • A cache line is typically 64 bytes; a tag identifies which memory block it holds.
  • A cache hit returns data in a few cycles; a miss forwards the request to RAM.
  • Temporal locality reuses recent data; spatial locality uses nearby addresses.
  • L1 is smallest and fastest, L2 is larger, and L3 is largest and often shared.
  • Virtual memory divides a logical address space into pages, commonly 4 KiB.
  • The MMU translates pages to physical frames through a page table; the TLB caches recent translations.
  • A page fault loads a missing page from storage; excessive paging is thrashing.
Cache and virtual memory
Average access time = h x t_hit + (1 - h) x t_miss
h = hit rate, t_hit = hit time, t_miss = miss penalty
05

Magnetic, optical and solid-state storage

Secondary storage is nonvolatile and much larger than main memory. Magnetic, optical and solid-state media use different recording mechanisms.

  • Magnetic HDD: platters spin at 5,400 or 7,200 rpm and a read/write head seeks tracks.
  • HDD average seek time is about 9 ms; sustained transfer is roughly 100-200 MB/s.
  • Magnetic tape is sequential, cheap and dense, so it is used for backup and archives.
  • Optical: a laser reads pits; CD holds about 700 MB, DVD 4.7 GB per layer and Blu-ray 25 GB per layer.
  • Optical media are cheap and portable but slow to write and increasingly uncommon.
  • NAND flash SSD has no moving parts; NVMe reads several GB/s with latency under 0.1 ms.
  • Flash endurance is finite: cells wear out after a limited number of erase cycles.
Magnetic, optical and solid-state storage
PropertyMagnetic (HDD/tape)Optical (CD/DVD/Blu-ray)Solid-state (SSD)
MechanismMagnetised regions on platters or tapeLaser reads pits and landsCharge stored in NAND flash cells
Typical capacity1-20 TB HDD; many TB tape700 MB CD; 4.7 GB DVD; 25 GB Blu-ray256 GB-4 TB
LatencyAbout 5-10 ms HDD; seconds for tapeTens of millisecondsUnder 0.1 ms
Cost per TBLowLowHighest
Best useBulk storage and backupMedia and archival copiesOperating systems and random I/O
06

Peripherals and interfaces

Peripherals provide input, output or storage. The interface must supply enough bandwidth for the device.

  • Input peripherals: keyboard, mouse, scanner, webcam, microphone and sensor.
  • Output peripherals: monitor, printer, speaker and actuator; a touchscreen is both input and output.
  • Storage peripherals: external HDD, SSD and tape drive.
  • USB 2.0 carries up to 480 Mb/s; USB 3.2 exceeds 5 Gb/s, where Mb/s and Gb/s are megabits and gigabits per second.
  • HDMI carries digital video and audio; SATA and NVMe connect storage devices.
  • A slow interface bottlenecks a fast device, so match port bandwidth to device bandwidth.

Exam points

  • Hierarchy order by speed is registers, cache, DRAM, SSD, HDD, tape; cost per bit falls in the same order.
  • SRAM uses flip-flops, needs no refresh and serves as cache; DRAM uses capacitors, needs refresh and serves as main memory.
  • SRAM and DRAM are volatile; ROM, flash, magnetic and optical storage are nonvolatile.
  • PROM is one-time programmable, EPROM is UV-erasable, and EEPROM or flash is electrically erasable.
  • Cache exploits locality; virtual memory maps pages to frames and uses a TLB, with page faults served from storage.
  • HDDs are magnetic and mechanical, optical discs use a laser, and SSDs use NAND flash with latency under 0.1 ms.

Key terms

Memory hierarchy
The ordered levels of storage from registers and cache to RAM, SSD, disk and tape, arranged by speed, capacity and cost per bit.
Virtual memory
A scheme that gives each program a logical address space mapped to physical frames, allowing programs larger than available RAM.
Cache hit
A memory access whose requested block is already present in cache, avoiding an access to the next lower level.

Check yourself

Quick check

0 / 2 answered
01

Which memory is volatile and needs periodic refresh?

02

A cache has a 0.9 hit rate, 1 ns hit time and 100 ns miss penalty. What is the average access time?

IT Fundamentals · Computer organization, memory, number systems, Boolean algebra, microprocessors, software, and MS Office.