We all are using computer , mobile phones , tablets , etc.These things need memory and processor to work. Processor is for executing the tasks we are giving them with the help of programming language.

See What is Programming?

Why we need memory?

It's okay. Now we are going to add two numbers using calculator.The numbers are 5and 10.

  1. press number 5
  2. press '+'
  3. Now on screen there will be 5 only.And then
  4. press number 10
  5. Now on screen 10 only then
  6. press '='
It's showing the answer:15
Coming to the point there was only 10 and we pressed = then the correct answer came to the screen.how? For this we are using memory. To store the data.
Yep! you are correct we are using memory to store files like audio , video , images , etc.

Types of Memory In Computer

Machines have two type of memory.Those are

  • Primary Memory
  • Secondary Memory

Secondary Memory - ROM

First talk about secondary memory. This is the one we are using to store files like audio , video.It's called

Read Only Memory (ROM)
CD-ROM , HARD DISK , MEMORY CARD , PEN DRIVE these are example of ROM.
We can use this memory for programming but the problem is speed.we need our programs to work very fast.If we use ROM for program then the program will be executed very slowly.

Primary Memory - RAM

For example when we are copying our movie file(appx. 1GB) it might take 5mins to copy.Now you are going to play GTA using ROM. what will happen? that game will move very slowly as copying movie.because we need data to execute program we can't just doing printing work.we have to calculate something. our processor will finish our work .but data?it's problem.so we need memory which acts at a speed of processor.Here , that's why we need

Random Access Memory (RAM)
we don't use this for storing movies or songs.it's only for programming.because the data stored in this memory will be deleted when we shutdown the computer.
because it needs power to contain the data.but it is very fast and volatile memory. so it is programmable memory.

Difference Between ROM and RAM

ROMRAM
FastSlow
VolatileNon-Volatile
High CostLow Cost
Programmable memoryTo store files like audio,video,etc