Types of Memory
COS2621 - Computer Organisation · Computer Memory
Types of Memory
Memory is a crucial component of computer organisation. It stores data and instructions for processing. Different types of memory serve various purposes in a computer system. This section discusses the main types of memory, their characteristics, and their roles in a computer.
1. Primary Memory
Primary memory, also known as main memory or RAM (Random Access Memory), is where the computer stores data that is actively being used or processed. It is fast and volatile, meaning it loses its contents when the power is turned off.
1.1 Random Access Memory (RAM)
RAM is the most common type of primary memory. It allows data to be read and written in any order, which is crucial for efficient processing. RAM is divided into two main types:
- Dynamic RAM (DRAM): This type of RAM stores each bit of data in a separate capacitor. It needs to be refreshed thousands of times per second to maintain the data.
- Static RAM (SRAM): This type uses flip-flops to store data, which makes it faster and more reliable than DRAM. However, it is more expensive and consumes more power.
Remember: RAM is volatile memory and loses its data when power is off.
1.2 Read-Only Memory (ROM)
ROM is a type of non-volatile memory. It retains its contents even when the power is off. ROM is used to store firmware, which is software that is closely tied to specific hardware and unlikely to need frequent updates. There are several types of ROM:
- Prom (Programmable ROM): Can be programmed once after manufacturing.
- EPROM (Erasable Programmable ROM): Can be erased and reprogrammed using ultraviolet light.
- EEPROM (Electrically Erasable Programmable ROM): Can be erased and reprogrammed using electrical signals.
Tip: ROM is used to store firmware and is non-volatile.
2. Secondary Memory
Secondary memory is used for long-term data storage. It is non-volatile and retains data even when the computer is turned off. Secondary memory is slower than primary memory but offers larger storage capacity. Common types of secondary memory include:
- Hard Disk Drives (HDDs): Use magnetic storage to read and write data. They are commonly used for storing large amounts of data.
- Solid State Drives (SSDs): Use flash memory to store data. They are faster than HDDs and have no moving parts, making them more durable.
- Optical Discs: Such as CDs, DVDs, and Blu-ray discs, use laser technology to read and write data.
- USB Flash Drives: Portable storage devices that use flash memory.
Watch out: Do not confuse primary memory (RAM) with secondary memory (HDD, SSD).
3. Cache Memory
Cache memory is a small amount of high-speed memory located inside or close to the CPU (Central Processing Unit). It stores frequently accessed data and instructions to speed up processing. Cache memory is faster than RAM but smaller in size. It is divided into levels:
- L1 Cache: Located inside the CPU, it is the fastest and smallest cache.
- L2 Cache: Larger than L1 but slower, it is also located inside the CPU or on a separate chip.
- L3 Cache: Even larger and slower, it is shared among multiple CPU cores.
Remember: Cache memory improves processing speed by storing frequently accessed data.
4. Virtual Memory
Virtual memory is a memory management technique that uses a portion of the hard drive as if it were additional RAM. This allows the computer to run more applications than the physical RAM can support. The operating system manages virtual memory by swapping data between RAM and the hard drive.
Tip: Virtual memory helps run more applications simultaneously but is slower than physical RAM.
5. Summary of Memory Types
- Primary Memory: Fast, volatile memory used for active data (e.g. RAM, ROM).
- Secondary Memory: Non-volatile, long-term storage (e.g. HDD, SSD).
- Cache Memory: High-speed memory for frequently accessed data.
- Virtual Memory: Uses hard drive space as additional RAM.
Check your understanding
- What is the main difference between RAM and ROM?
- List the three types of cache memory and their characteristics.
- Explain the role of virtual memory in a computer system.
- What are the advantages of using SSDs over HDDs?