Ez Computerहिन्दीOpen app

Primary Memory — RAM, ROM and Cache

Preview Part B: Hardware · Chapter 6 · 19 min read · 57 practice questions

After this chapter you will be able to

  • explain the memory hierarchy and why it exists
  • compare primary and secondary memory
  • distinguish RAM types (SRAM, DRAM, SDRAM, DDR) and ROM types (PROM, EPROM, EEPROM, flash)
  • explain cache memory, hits, misses and write policies
  • explain virtual memory, paging and memory allocation methods
  • convert between memory units confidently
Primary MemoryMemory basicsRegister, cache, RAM, diskFaster = smaller, costlierVolatile vs non-volatilePrimary vs secondaryPrimary: CPU reaches directlySecondary: via RAM firstRAM volatile, ROM notRAMSRAM: cache, no refreshDRAM: main RAM, refreshDDR5 is currentROM and flashPROM: write onceEPROM: UV light eraseEEPROM: electric eraseCacheHit = found, miss = notL1 fastest, L3 largestWrite-through or write-backVirtual memory, unitsPaging: page to framePage fault, thrashing1 KB = 1024 bytes
Chapter 6 at a glance Recall: the memory ladder, primary vs secondary, RAM and ROM types, cache hits, and virtual memory.

6.1 What Is Memory?

Memory is the part of the computer that stores data and instructions.

6.2 The Memory Hierarchy

Faster memory is costlier and smaller. So computers use a ladder of memories.

FigureMemory Hierarchy
↑ Faster · costlier per bit · closer to CPU
  1. Registersinside the CPU
  2. CacheL1 · L2 · L3
  3. Main memoryRAM
  4. Secondary storageSSD / HDD
  5. Tertiary / offlineoptical disc, magnetic tape, cloud backup
↓ Larger capacity · cheaper per bit · slower
Level Speed Capacity Volatile?
Registers Fastest Bytes Yes
Cache Very fast KB – MB Yes
RAM Fast GB Yes
SSD / HDD Slower GB – TB No
Optical / tape Slowest TB (tape) No

★ EXAM POINT — Order of speed (fastest first): Register > Cache > RAM > SSD > HDD > Optical disc > Magnetic tape. Order of capacity is the reverse.

What the full chapter covers

The full chapter has these sections:

  1. 6.1 What Is Memory?
  2. 6.2 The Memory Hierarchy
  3. 6.3 Primary vs Secondary Memory
  4. 6.4 RAM — Random Access Memory
  5. 6.5 ROM — Read Only Memory
  6. 6.6 Cache Memory
  7. 6.7 Virtual Memory
  8. 6.8 Memory Allocation Methods
  9. 6.9 Other Memory Terms
  10. 6.10 Units of Memory
  11. 6.11 More Memory Terms
  12. 6.12 Inventions and Milestones
  13. Chapter Quick Revision
  14. Most Important Terms
  15. Common Confusions
  16. Rapid Recall

Sample questions from this chapter

1. RAM acts as the processor's ___?

  1. Page file
  2. Waiting room
  3. Hard disk
  4. Registers
Show answer

Answer: B. Waiting room

RAM holds the data and programs the CPU is about to use, like a waiting room.

2. Minimum gap between two successive memory operations?

  1. Refresh period
  2. Cycle time
  3. Transfer rate
  4. Access time
Show answer

Answer: B. Cycle time

Cycle time is the minimum gap between the starts of two memory operations; it is never less than access time.

3. Typical cache size in older PCs?

  1. 256 KB to 4 MB
  2. 16 GB to 64 GB
  3. 1 GB to 4 GB
  4. 64 MB to 512 MB
Show answer

Answer: A. 256 KB to 4 MB

Older PCs had caches of about 256 KB to 4 MB; modern L3 caches are much larger.

4. Year PROM was invented?

  1. 1956
  2. 1946
  3. 1966
  4. 1971
Show answer

Answer: A. 1956

PROM was invented by Wen Tsing Chow in 1956; it is a ROM that can be programmed once.

5. Flash type used in memory cards and USB drives?

  1. NOR flash
  2. Mask ROM
  3. EPROM
  4. NAND flash
Show answer

Answer: D. NAND flash

NAND flash is dense and cheap per bit, so it is used in memory cards, USB drives and SSDs.