Computer Architecture
ROM Types; Auxiliary Memory; Cache Memory
C-CAT
ROM Types
ROM is non-volatile — contents survive power-off. Used for boot code, firmware, lookup tables.
| Type | Programmable? | Erasable? | Notes |
|---|---|---|---|
| Mask ROM | At factory | No | Cheapest mass production |
| PROM | Once (fuse) | No | User burns pattern once |
| EPROM | Yes | UV erase (window) | Lab/prototype friendly |
| EEPROM | Yes | Electrically | Byte/sector erase, in-system update |
Modern systems often use flash memory (EEPROM family) for BIOS/UEFI.
Auxiliary Memory
Auxiliary memory provides backup and bulk storage when primary RAM is insufficient or power is removed.
Examples:
- Magnetic disks and tapes
- Optical discs (CD/DVD/Blu-ray)
- Magnetic drums (historical)
Magnetic bubble memory (historical)
- Modern SSD/NVMe (flash-based auxiliary store)
Characteristics: large capacity, low cost per bit, slow access, not directly on CPU's critical path except via I/O or DMA.
Cache Memory
Cache stores copies of main memory locations that the CPU reuses often, so repeated accesses avoid slow DRAM latency.
12.1 Operation
- CPU needs a word at address A.
- Check cache first.
- Hit: word found in cache — fast return.
- Miss: fetch from main memory; often load a block (line) into cache for locality.
12.2 Hit Ratio
[ \text{Hit Ratio} = \frac{\text{Hits}}{\text{Hits} + \text{Misses}} ]
Higher hit ratio ⇒ average memory access time approaches cache speed.
12.3 Placement Between CPU and RAM
CPU ──▶ [L1 Cache] ──▶ [L2/L3] ──▶ Main RAM ──▶ Disk
(fast SRAM) (SRAM) (DRAM)
Exam point: Cache sits between CPU and RAM, not between RAM and ROM.
Read-Only and Secondary Storage
Mask ROM is programmed during manufacture. PROM is programmed once by the user. EPROM can be erased with ultraviolet light and reprogrammed. EEPROM is electrically erased while flash memory erases larger blocks and provides dense nonvolatile storage. Firmware commonly resides in nonvolatile memory because it must survive power loss.
Auxiliary storage retains far more data than main memory at lower cost per bit. Magnetic disks organize data into sectors and incur seek, rotational and transfer time. Solid-state drives use flash memory and remove mechanical seek but require controllers for wear leveling, error correction and block erasure. Optical media encode data on tracks read by laser. Storage devices transfer blocks rather than individual processor words.
Cache Organization
A cache keeps recently or nearby used memory blocks close to the processor. Temporal locality means recently accessed items are likely to be reused. Spatial locality means nearby addresses are likely to be accessed. A hit finds the requested block in cache while a miss fetches it from a lower level.
Direct mapping gives each memory block one cache line. Fully associative mapping permits any line. Set-associative mapping permits any line within one selected set. Replacement chooses a victim when a set is full. Write-through immediately updates lower memory while write-back delays that update until a dirty line is replaced. Average access time depends on cache hit time, miss rate and miss penalty.
Continue learning
Related notes
Put this topic into timed practice
Open mock tests when you want full-exam pacing, or keep drilling in practice mode.