COMP109 – Lecture 5 Notes (Memory & Storage Devices)

Objectives

  • By the end of this lecture, students should be able to:
    • Define and differentiate the two major categories of computer memory.
    • Identify and describe all variants of ROM.
    • Identify and describe all variants and sub-variants of RAM.
    • Explain every factor that affects RAM speed (including how each factor is measured).
    • Recognize and define common OS memory–management terms.
    • Describe, step-by-step, how RAM interacts with CPU cache and registers during program execution.
    • Distinguish primary memory from secondary storage.
    • List and explain the common properties shared by all storage systems.
    • Name the two primary magnetic-disk families and explain their inner workings.

Introduction

  • Focus areas:
    • Primary memory (RAM & ROM) architecture, operation, and performance.
    • OS‐level memory management (conventional, UMA, XMS, virtual memory).
    • Secondary storage families (magnetic, optical, solid-state, magneto-optical, tape, RAID, online services).
    • Comparative properties, advantages, disadvantages, and real-world relevance.

Two Main Categories of Memory

  • Read-Only Memory (ROM)
    • Non-volatile: retains content when power is off.
    • Stores firmware & critical system software (e.g., BIOS, embedded controllers).
  • Random Access Memory (RAM)
    • Volatile: loses data when power is removed.
    • Workspace for currently running programs & data.

ROM Families

  • Mask ROM
    • Programmed at fabrication via photolithographic “masks.”
    • Advantage:\text{Advantage:} cheapest per bit; very compact.
    • Drawback:\text{Drawback:} high one-time mask cost & long lead time; design errors = total loss.
  • PROM (Programmable ROM)
    • Shipped blank; user/company programs once with a PROM programmer.
    • Ideal for small/medium production runs & late-binding firmware.
    • Typical use cases: micro-controllers, RFID, game consoles, mobile devices, HDMI gear, automotive ECUs.
  • EPROM (Erasable PROM)
    • Array of floating-gate transistors; erased via intense UV\text{UV} light through quartz window.
    • Reusable but requires removal from circuit for erasure/programming.
  • EEPROM (Electrically Erasable PROM)
    • Byte-addressable erase/write in-circuit via special voltages.
    • Modern devices allow multi-byte page operations & (\approx 10^6) re-write cycles.
    • Foundation for Flash memory when scaled to large pages/blocks.

RAM

Static RAM (SRAM)
  • Stores data in flip-flop latches (no refresh cycle).
  • Used for on-chip caches (L1, L2, sometimes L3) and discrete cache modules.
Dynamic RAM (DRAM)
  • Stores charge in tiny capacitors; leaks, so requires periodic refresh (≈ every 2–10 ms2–10\,\text{ms}).
  • Found on SIMM, DIMM, or RIMM modules.
DRAM Module Types
  • SIMM – pins on both sides wired together (single contact set).
  • DIMM – independent pins on each side (two contact sets).
  • RIMM – module carrying Rambus DRAM; unused motherboard sockets must be filled with CRIMMs.
DRAM Signaling / Technologies
  • Fast Page Mode (FPM) – keeps (RAS) low across multiple (CAS) cycles; boosts burst reads.
  • Extended Data Output (EDO) – overlaps cycles (pipelining); ≈ 5%5\% faster than FPM.
  • SDRAM – synchronous, clock-driven finite-state machine; multiple internal banks for interleaving.
  • DDR SDRAM – double-pumps data (rising & falling edge) → nearly (2\times) SDR bandwidth at same clock.
  • RDRAM (Rambus) – high-speed packetised bus; lost market to DDR due to cost/performance issues.

Factors Determining RAM Speed

  • Raw Device Speed
    • Advertised in ns\text{ns} (older parts) or clock rate MHz\text{MHz} / data-rate MT/s\text{MT/s} (newer).
  • Technology Generation
    • SDRAM, DDR, DDR2/3/4, RDRAM, etc.
  • Latency Metrics
    • CAS Latency (CL) – cycles between column request & data availability. Lower CL\text{CL} = better.
    • RAS Latency (tRCD) – cycles to latch row address.
    • Overall latency = sum of multiple timing parameters.
  • Error Checking Method
    • Parity (1-bit error detection).
    • ECC/FEC (detect & correct; used in servers/CDs/DVDs/etc.).
  • Channel Architecture
    • Single Channel – one data path.
    • Dual Channel – two independent 64-bit paths → theoretical 2×2\times peak bandwidth (real-world ≈ 5%5\% gain for typical workloads).

OS Memory-Management Vocabulary

  • Conventional (Base) Memory
    • First 640 KB640\,\text{KB} → 640×1024 bytes640\times 1024\,\text{bytes} directly addressable in real-mode IBM PCs.
  • UMA (Upper Memory Area)
    • 0xA00000xA0000–0xFFFFF0xFFFFF (640–1024 KB); originally reserved for ROM, video RAM, I/O; later reused via UMBs.
  • Extended Memory (XMS)
    • Above 1 MB1\,\text{MB} on 80286+80286+; accessed in DOS via HIMEM.SYS & XMS API.
  • Virtual Memory
    • Hardware MMU translates virtual → physical addresses.
    • OS uses paging to extend apparent RAM beyond installed physical capacity.
    • Benefits: isolation, security, simplified programming, larger working sets.

How RAM, Cache, and CPU Interact

  • Every RAM location holds an address; CPU issues address on bus.
  • Retrieval pipeline:
    1. CPU consults L1 cache.
    2. On miss, consults L2 (and possibly L3) cache.
    3. On L-cache miss, memory controller fetches from DRAM into cache line; registers stage operands for ALU.
  • Registers = smallest, fastest storage; directly feed execution units.
  • Flash memory (NOR/NAND) provides non-volatile, solid-state storage—sometimes called “flash RAM.”

Storage Systems – General Properties

  • Consist of a storage device + storage medium.
  • Media traits:
    • Non-volatile vs. volatile.
    • Fixed (non-removable) vs. removable.
    • Access mode: sequential vs. direct/random.
  • Data stored as files; user sees logical hierarchy (folders). Physical representation differs (blocks, sectors, clusters).
  • Read/write head proximity & medium motion critical for magnetic & optical devices.

Magnetic Disk Systems

Floppy Disks
  • 3.5-inch high-density hold 1.44 MB1.44\,\text{MB}; formatted into tracks/sectors → clusters; now largely obsolete.
  • Super-disk technologies: Zip (100/250 MB100/250\,\text{MB}), SuperDisk, Hi-FD.
Hard Disks
  • Single sealed HDA (head-disk assembly).
  • Internal & external; capacities in multi-GB → TB range.
  • Geometry terms:
    • Track, Sector, Cluster.
    • Cylinder = aligned tracks across platters.
    • Multiple heads (one per surface) hover on air cushion; contact ⇒ head crash.
  • Timing components:
    • Seek Time (head moves to track).
    • Rotational Delay (wait for sector under head).
    • Data Movement Time (actual transfer).
    • Total =) Disk Access Time.
  • Disk Caching: Prefetch neighboring data into RAM cache to mask latencies.
  • Interface Standards: ATA/IDE, SCSI, upcoming Fibre Channel (networked storage).
  • Partitioning: subdivides drive into logical volumes (e.g., C:, D:) with independent file systems (FAT32, NTFS).
  • Removable Hard-Cartridge examples: Jaz, Peerless.
  • Large systems may use arrays or RAID for capacity & fault-tolerance.

Optical Storage

  • Uses laser beam & tiny pits/lands.
  • CD Family (≈ 650\,\text{MB}):
    • CD-ROM (pressed, read-only).
    • CD-R (recordable once).
    • CD-RW (rewritable many times).
    • Variants: Photo CD, mini-disc (DataPlay ≈ 500\,\text{MB}).
  • DVD Family:
    • DVD-ROM (read-only; movie distribution).
    • DVD-R / DVD+R (record once), DVD-RW / DVD+RW, DVD-RAM (rewritable).
    • Capacities 4.7\,\text{GB}(single−layer,single−side)→(single-layer, single-side) →17\,\text{GB} (dual-layer, double-side).
  • Magneto-Optical Discs: hybrid magnetic write + optical read; niche archival role.

Magnetic Tape

  • Historically main backup/archive medium; still prevalent due to low cost per GB.
  • Cartridge or open-reel; sequential access only; requires tape drive & sometimes robotic libraries.

Solid-State & Portable Storage

  • Flash Memory Devices
    • Flash sticks (4–64\,\text{MB}legacy;modernlegacy; modern\text{GB} range) and flash cards (CF, SM, SD, MMC, etc.).
    • No moving parts → shock-proof, low power.
  • Smart Cards
    • Credit-card form factor, few MB, embedded micro-controller/EEPROM.
    • Store prepaid value, ID, medical data, etc.; read by dedicated readers/phones.
  • Online (Cloud) Storage
    • Remote servers accessible via Internet; supports primary storage, backup, sharing.

RAID (Redundant Array of Independent Disks)

  • Virtualizes multiple physical disks into single logical volume for performance &/or redundancy.
  • Core Goals: reliability, availability, performance, capacity.
  • Standardized by SNIA DDF.
  • Key Levels:
    • RAID 0: striping, n−diskthroughput,-disk throughput,0 redundancy.
    • RAID 1: mirroring, read concurrency, full redundancy, write cost.
    • RAID 2: bit-level striping + Hamming parity (historic only).
    • RAID 3: byte-level striping + dedicated parity (rare).
    • RAID 4: block-level striping + dedicated parity (NetApp origin).
    • RAID 5: block-level striping + distributed parity; tolerates 1-disk failure; rebuild risk.
    • RAID 6: block-level striping + dual parity; tolerates 2-disk failures; recommended for large arrays.

The Need for Backups – Practical & Ethical Implications

  • Potential data-loss events:
    • Bad sectors, accidental deletes, mistaken overwrites, erroneous formatting.
    • Head crash, power failure during write, hardware/software faults, malware.
    • Environmental disasters (fire, flood), theft.
  • Ethical duty for professionals to safeguard client data; critical for business continuity & personal digital assets.

Evaluation / Quick Summary

  1. Memory ⇒ RAM (volatile) vs. ROM (non-volatile).
  2. ROM types: Mask, PROM, EPROM, EEPROM – distinguished by programming & erase method.
  3. RAM types: SRAM (static) vs. DRAM (dynamic).
  4. DRAM module formats: SIMM, DIMM, RIMM.
  5. DRAM technologies: FPM, EDO, SDRAM, DDR, RDRAM.
  6. RAM speed factors: device speed, technology gen, latency, error-checking, channel count.
  7. Conventional/Base memory =640\,\text{KB};UMA; UMA=640–1024\,\text{KB};Extended; Extended>1\,\text{MB}$$.
  8. Virtual memory combines HW MMU + OS paging for large, secure address space.
  9. Storage ≈ device + medium; properties: volatility, removability, access mode.
  10. Magnetic, optical, magneto-optical, flash, tape, RAID each serve different niches; backups remain essential.

Guide-Question Hints

  • Q1 ROM vs. RAM: volatility, purpose (firmware vs. workspace), physical location, erase/write capabilities.
  • Q2 ROM Types: mask (factory), PROM (user-once), EPROM (UV-erasable), EEPROM (in-circuit electrical erase).
  • Q3 DRAM Techs: FPM (basic page), EDO (pipelined), SDRAM (sync), DDR (double-pumped), RDRAM (packet bus).
  • Q4 Files vs Folders: logical hierarchy vs. physical blocks/sectors; directory table vs. cluster map.
  • Q5 Storage Properties: volatility, removability, access mode, capacity, speed, cost, durability, portability, security.
  • Q6 Backups: mitigate physical, logical, human, and malicious threats; support legal/ethical data-protection obligations.