In a computer, there are mainly two types of memory which are the primary memory and secondary memory.
The memories are what make a computer work efficiently and the major difference between both of these memories is that the primary memory is used for caching as it stores temporary data and it is fast in terms of the access time while the secondary memory is used for storing permanent files and it is slow in comparison to primary memory.
An example of the primary memory is the Random Access Memory (RAM) and it is used to cache frequently used data while an example of the secondary memory is our external hard disk.
Primary memory is also termed as main memory
It is also called internal memory
It is a temporary memory of a computer as it does not hold data for long period
It is fast in terms of access time as it does not store enormous data
It has a small storage capacity or size
It is close to the processor in the memory hierarchy
It communicates with the central processing unit (CPU) directly and that’s why it is fast
It is more expensive than secondary memory
It is volatile in nature (meaning that after power is remove the data stored on it is erased
Random access memory (RAM), read only memory (ROM), registers, cache memory are some of the examples of a primary memory
Secondary memory is also termed as auxiliary memory
It is also called the external memory
It is a permanent memory of a computer as it can hold data for a very long period of time
It is less fast in compare to the primary memory in terms of access time as it does store enormous data
It has a huge storage capacity or size
It is far from the processor in the memory hierarchy
It does not communicate with the central processing unit (CPU) directly
It is less expensive than primary memory
It is non-volatile in nature (meaning that after power is remove the data stored can still be retained)
Hard disk (HDD), Floppy Disc, magnetic tapes, DVD, FDD, pen drive etc. are examples of a primary memory