1. Random Access Memory (RAM) :
Random Access Memory (RAM) is used to store the programs and data being used by the CPU in real-time. The data on the random access memory can be read, written, and erased any number of times. RAM is a hardware element where the data being currently used is stored. It is a volatile memory. Two types of RAM are Static RAM, or (SRAM) and Dynamic RAM, or (DRAM).
2. Cache Memory :
Cache is a smaller and fast memory component in the computer which is inserted between the CPU and the main memory. To make this arrangement effective. The cache needs to be much faster than main memory. This approach is more economical than the use of fast memory devices to implement the entire main memory.
Difference between RAM and Cache :
|1.||RAM is a volatile memory which could store the data as long as the power is supplied.||Cache is a smaller and fast memory component in the computer.|
|2.||The size of ram is greater.||The size of cache memory is less.|
|3.||It is expensive.||It is not expensive.|
|4.||It holds programs and data that are currently executed by the CPU.||It holds frequently used data by the CPU.|
|5.||It is not fastest as compared to cache.||It is faster.|
|6.||Cache memory increase the accessing speed of CPU.||RAM is faster than a hard disk, floppy disk, compact disk, or just any form of secondary storage media.|
|7.||CPU reads Cache Memory data before reading RAM.||
CPU reads RAM data after reading Cache Memory.
|8.||It can be internal and external both.||It is generally internal.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Locality of Reference and Cache Operation in Cache Memory
- Difference between RAM and ROM
- Difference between Random Access Memory (RAM) and Hard Disk Drive (HDD)
- Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
- Difference between RAM and SRAM
- Random Access Memory (RAM) and Read Only Memory (ROM)
- Different Types of RAM (Random Access Memory )
- Sorting larger file with smaller RAM
- Magnetic Random Access Memory (M-RAM)
- RAM Full Form
- What's difference between CPU Cache and TLB?
- Difference between Virtual memory and Cache memory
- Difference between Cache and Cookies
- Difference Between APT, APT-GET, APT-CACHE and APT-CONFIG
- Difference between Buffer and Cache
- Difference between Cache Memory and Register
- Differences between Associative and Cache Memory
- Computer Organization | Locality and Cache friendly code
- Write Through and Write Back in Cache
- Cache Organization | Set 1 (Introduction)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.