Quiz 2
Registry Synced

Memory Systems — RAM, ROM, Decoder-Based Memory

485 words
2 min read

Reading compass

Now · 🎯 Learning Objectives

Memory Systems — RAM, ROM, Decoder-Based Memory

🎯 Learning Objectives

  • Distinguish SRAM vs. DRAM vs. ROM
  • Design decoder-based memory addressing
  • Explain memory hierarchy (cache, main memory, disk)
  • Analyze memory access times and hit rates

1. Memory Types

TypeVolatile?SpeedDensityCost/bitUse
SRAMYesFastest (1-10ns)Low (6T/cell)HighCache
DRAMYesFast (10-50ns)High (1T+1C)LowMain memory
ROMNoFastMediumMediumFirmware, BIOS
FlashNoMedium (read), Slow (write)Very highVery lowStorage

2. Decoder-Based Memory

2.1 Address Decoding

(Diagram) 1024 × 8-bit memory: 10 address lines (A0-A9), 8 data lines (D0-D7). Address map:
Address (Binary)Address (Hex)Word Selected
00 0000 0000000Word 0
00 0000 0001001Word 1
.........
11 1111 11113FFWord 1023

2.2 Chip Select

For larger memories, use chip select (CS) to enable specific memory chips: (Diagram)

3. Memory Hierarchy

LevelSizeAccess TimeManaged By
Registers100s bytes0.3nsCompiler
L1 Cache32-64KB1nsHardware
L2 Cache256-512KB3-5nsHardware
L3 Cache4-32MB10-15nsHardware
Main Memory8-64GB50-100nsOS
SSD256GB-2TB10-100μsOS/User
HDD1-10TB5-15msOS/User

4. Common Pitfalls

Pitfall: Confusing Byte Addressability with Word Size

The mistake: Assuming 32-bit address space means 32-bit words. Correct approach: 32-bit address space = 2^32 bytes = 4GB addressable. Whether the processor fetches 8, 16, 32, or 64 bits at a time is a different design choice.

5. Key Concepts Reference

ConceptDescription
SRAMStatic RAM (bistable latch)
DRAMDynamic RAM (capacitor, needs refresh)
Address decoderConverts address to chip/word select
Memory mapAssignment of addresses to memory regions
Chip selectEnables specific memory chip
EndiannessByte order (little-endian vs big-endian)

6. 📝 Practice Questions

Q1: How many address lines for a 64KB memory with 8-bit words?
Answer: 64KB = 64 × 1024 = 65536 bytes. Need log₂(65536) = 16 address lines (A0-A15). Q2: A system has 16-bit address bus with 8-bit data. Memory chips are 2KB each. How many chips needed?
Answer: Total addressable = 2^16 = 64KB. Each chip = 2KB. Chips needed = 64/2 = 32. Address lines per chip: 2KB = 2048, need 11 address lines. Remaining 5 address lines used for chip select (32 chips). Q3: Why does DRAM need refresh while SRAM doesn't?
Answer: DRAM stores charge on a capacitor, which leaks over time (typically 64ms). SRAM uses a bistable latch (6 transistors) that maintains state as long as power is applied. DRAM must read and rewrite every row periodically (refresh cycle), consuming ~1% of memory bandwidth. Q4: Calculate effective access time: L1 hit rate = 95%, L2 hit rate = 90%, L1 time = 1ns, L2 time = 10ns, main memory = 100ns.
Answer: Effective time = 0.95 × 1ns + 0.05 × (0.90 × 10ns + 0.10 × (10ns + 100ns)) = 0.95 + 0.05 × (9 + 11) = 0.95 + 0.05 × 20 = 0.95 + 1.0 = 1.95ns. Without cache: 100ns. Improvement: 50× faster.

7. 🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.