What is memory?
Memory in a computer system refers to the components that store data.
There are two different types of memory, and they have different purposes:
- Primary storage — fast memory that the CPU can access quickly
- Secondary storage — to store things for a long time
Primary Storage
Fast storage for data and instructions which the CPU can access.
Random Access Memory (RAM)
- Stores the programs and data which the computer is currently using
- Sometimes called main memory
- Volatile: data is wiped when the computer is turned off
- Example: My PC has 8 gigabytes of RAM
Read Only Memory (ROM)
- Memory which cannot be changed
- Non-volatile: data is retained, even when the computer is turned off
- Used to start-up the computer when it is first switched on
CPU Cache
- An area of super-fast memory on the CPU
- Frequently used instructions are kept in the cache — it’s quicker than getting them from RAM
- Cache memory is small and very expensive
Secondary Storage
Where we store data for a long time (such as our work, photos, program files, downloads). It is much slower than primary memory and cannot be accessed directly by the CPU.
Magnetic Storage
- Uses magnets to read and write data on spinning disks, such as hard disk drives and floppy disks.
- Pros: large storage, cheap
- Cons: slow, easily damaged
Optical storage
- Uses a laser to read and write data. Examples: CDs, DVDs, Blu-Rays
- Pros: Good for storing music, movies, games, and backups
- Cons: Slower than other types, can get scratched
Solid State
- Uses memory chips (no moving parts) to store data. Examples: USB sticks, SSDs (including NVMe storage) memory cards
- Pros: Fast, durable, small
- Cons: More expensive than magnetic for the same capacity
As demand for smaller, faster computing devices increases, many manufacturers are only using solid state storage in their computers.