Wednesday, December 3, 2025

✅ UNIT 5 — MEMORY & I/O ORGANIZATION

 

This unit explains how data is stored, accessed, and transferred inside a computer — essential for understanding how modern CPUs achieve high speed.


⭐ 5.1 Memory Hierarchy

Memory is organized in layers based on speed, cost, and capacity.

From Fastest → Slowest

  1. Registers

  2. Cache Memory

  3. Main Memory (RAM)

  4. Secondary Memory (HDD/SSD)

  5. Tertiary (CD/DVD)

Key Idea:

  • Higher levels → faster, expensive, smaller

  • Lower levels → slower, cheap, larger

CPU always tries to read from the fastest possible level.


⭐ 5.2 Cache Memory

Cache = small, very fast memory between CPU & RAM.

Why cache is needed?

Because CPU is extremely fast but RAM is slower → cache avoids waiting.


Types of Cache

1. L1 Cache

Fastest, smallest, inside CPU core.

2. L2 Cache

Bigger, slower.

3. L3 Cache

Shared between multiple cores.


Cache Mapping Techniques

1️⃣ Direct Mapping

Each block of main memory maps to exactly one cache line.

Advantages: Simple
Disadvantages: Conflict misses

2️⃣ Associative Mapping

Any memory block → any cache line.

Advantages: Flexible
Disadvantages: Expensive hardware

3️⃣ Set-Associative Mapping

Memory block → a small set of cache lines.
Most commonly used.


⭐ 5.3 Main Memory (RAM + ROM)

RAM Types

  • SRAM → used in cache

  • DRAM → used in main memory

ROM Types


⭐ 5.4 Memory Interleaving

Memory speed can be increased by storing data across multiple banks.

Types:

1️⃣ Lower-Order Interleaving

Low-order bits choose memory bank.

2️⃣ Higher-Order Interleaving

High-order bits choose memory bank.

Goal: Increase reading speed by accessing multiple banks simultaneously.


⭐ 5.5 Associative Memory (Content Addressable Memory)

Data is accessed by content, not by address.

Used in:

  • Cache tag matching

  • TLB (Translation Lookaside Buffer)


⭐ 5.6 I/O Organization

Two main categories:

1️⃣ Programmed I/O

CPU controls I/O directly.
Simple but slow.

2️⃣ Interrupt-Driven I/O

I/O device interrupts CPU when ready.
Faster than programmed I/O.

3️⃣ Direct Memory Access (DMA)

Fastest I/O method.

DMA Features:

  • Transfers data directly between memory & I/O

  • CPU is freed during transfer

  • Very efficient for large data (disk, graphics)


⭐ 5.7 Memory-Mapped vs I/O-Mapped I/O

FeatureMemory-Mapped I/OI/O-Mapped I/O
Address SpaceUses normal memory addressesSeparate I/O address space
InstructionsNormal memory instructionsSpecial I/O instructions (IN, OUT)
SpeedFasterModerate
ExampleModern CPUs8085 (IN/OUT)

⭐ 5.8 Secondary Storage Concepts

HDD

SSD

  • No moving parts

  • Much faster

  • Expensive

CD/DVD

No comments:

Post a Comment

✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA (DISCRETE MATHEMATICS)

  ✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA 1. Poset Partially Ordered Set A pair (A, ≤) where relation is: Reflexive Anti-...