Computer Memory
Memory: The electronic holding place for instructions and data that computer's microprocessor can reach quickly.
1. Memory Hierarchy
Ordered by Speed (Fastest to Slowest) and Cost (Highest to Lowest):
- CPU Registers: Inside the CPU. Fastest. Smallest capacity.
- Cache Memory: Between CPU and RAM. Very fast (SRAM).
- Primary Memory (RAM): Main memory. Volatile.
- Secondary Memory: HDD/SSD. Non-volatile. Slowest but largest capacity.
2. Primary Memory (Main Memory)
Directly accessible by the CPU.
A. RAM (Random Access Memory)
Volatile Memory: Data is lost when power is switched off. Read/Write memory.
- SRAM (Static RAM): Uses Flip-Flops. Faster, expensive, uses more power. Used in Cache.
- DRAM (Dynamic RAM): Uses Capacitors. Slower, cheaper, needs frequent refreshing. Used in Main Memory.
B. ROM (Read Only Memory)
Non-Volatile Memory: Data is retained when power is off. Read-only. Stores BIOS (Bootstrap loader).
- PROM (Programmable ROM): Can be programmed once by user.
- EPROM (Erasable PROM): Can be erased using UV light and reprogrammed.
- EEPROM (Electrically Erasable PROM): Can be erased electrically. Used in Flash Drives/SSDs.
3. Secondary Memory (Auxiliary Memory)
Used for permanent storage. CPU does not access it directly; data is moved to RAM first.
- HDD (Hard Disk Drive): Magnetic storage. Uses spinning platters and read/write heads. Cheap, high capacity.
- SSD (Solid State Drive): Flash memory. No moving parts. Faster, durable, more expensive than HDD.
- Optical Disks:
- CD (Compact Disc): ~700 MB.
- DVD (Digital Versatile Disc): ~4.7 GB to 8.5 GB.
- Blu-ray Disc: ~25 GB to 50 GB.
- Flash Memory: USB Pen Drives, SD Cards. Portable and durable.
- Floppy Disk: Obsolete. 1.44 MB capacity.
4. Cache Memory
Special high-speed memory area allocated or reserved that copies frequently accessed data from main memory for faster CPU access.
Levels: L1 (Internal, fastest), L2 (External/Internal), L3 (Shared).