1.
Magnetic Tape, Disk, Optical Storage
Magnetic Tape:
- Advantage: Low cost, good for backups, stores large data.
- Disadvantage: Slow access, sequential reading.
Magnetic Disk (like HDD):
- Advantage: Faster than tape, random access, widely used.
- Disadvantage: Mechanical wear, slower than SSD.
Optical Storage (CD/DVD/Blu-ray):
- Advantage: Portable, long shelf life, read-only versions available.
- Disadvantage: Limited storage, slower than hard disks.
2. All Mapping Schemes in Cache
1. Direct Mapping:
- Each block of main memory maps to only one cache line.
- Simple and fast but causes many collisions.
2. Fully Associative Mapping:
- Any block can go into any cache line.
- Flexible, fewer collisions but complex and costly.
3. Set Associative Mapping:
- Cache divided into sets; block maps to any line in a set.
- Balance between speed and flexibility.
3. All Replacement Algorithms
1. FIFO (First-In, First-Out): Remove oldest page first.
2. LRU (Least Recently Used): Remove page not used for longest time.
3. Optimal: Remove page not needed for longest future use (ideal, theoretical).
4. Random: Randomly pick a page to remove.
4. Memory Management
- Handles allocation of memory to programs.
- Types:
1. Contiguous Allocation (single block per process).
2. Paging (divide memory into fixed-size pages).
3. Segmentation (divide by logical units like functions/arrays).
4. Virtual Memory (uses disk as extra memory).
5. Cache vs Virtual Memory
Cache:
- Small, fast memory between CPU and RAM.
- Stores frequently used data.
- Improves speed.
Virtual Memory:
- Uses part of hard disk as RAM.
- Allows large programs to run on limited RAM.
- Prevents memory overflow.