Computer Memory for Beginners

4 minute read

This blog was originally posted on Medium

I know that many of you have heard about Registers, Cache, RAM, Hard disks but never understood how they really work. Even though, this concept is very similar in devices like Mobiles, Computers and Servers it can be little difficult to understand their working if you are new this concept. Today, in my first blog post, I will be trying to explain to you about their working with some easy to understand the analogy.

To understand their working better, let us imagine that we have a friend named John. He is studying mathematics for his exams which is coming soon. He comes across a type of problem which he wants to solve. He reads that problem and realises that he has never come across this type of problem before.

boy studying
boy studying by Brad Neathery

Now he decides to look for the explanation on how to solve this problem in his notes which was already in his hand. After looking for a while in his notes, he finds out that the explanation is not present in his notes. So he decided to search for the explanation in his reference book kept on the table.

Now he is going through different reference books on the table trying to find an explanation. However, after searching for a while, he understands that the solution to the problem is not explained in any of the reference books on the table. Now, he is left with only one option, which is to look up in his school library to find a book through which he can understand how to solve the problem.

library by chuttersnap

Soon he visits his school library and finds a book for the same topic as his problem is. He decides to take that book from the library and keeps it on his table and starts reading it to understand and later solve the problem. Hurray!

Now let’s re-look at the same story to understand how computer memories work. The story begins with a boy named John, who is trying to solve some mathematical problems. He comes across a problem which he doesn’t understand. He comes to the conclusion that he doesn’t understand that problem. He comes to that conclusion by comparing it with all other types of problem which he has seen before in his head (registers). But it feels almost immediately because of the speed of the human brain, which is the same with computer registers. It is the fastest type of memory in a computer, but the capacity of a register to hold the data is the least, when compared to other memory types.

Then he tries to look for a similar solution in his notes, which he is holding in his hand. So his hand will be a substitute for the cache memory. The access time of cache memory is slower than the registers, but the capacity of the cache is higher than of registers.

Next, he is trying to find the problem in a reference book on his table. So the table can be considered as a RAM. We can keep more books on a table(RAM), than holding it on hand(Cache). Which says that RAM has a higher capacity than that of the cache. However, the access time of RAM is slower than that of the cache.

In the end, John was able to find the solution in a book in his library. So the library can be considered as a Hard Disk. The storage capacity of a hard disk is higher than that of a RAM. However, the access time is even slower than that of RAM.

We should not forget that after he found the solution in a book in his library (Hard Disk), he took that book home and kept it on the table (RAM), then hold it in his hand (Cache) and then he read the book and transferred that information to his brain (Registers). Which is none or less the way in which the computers work.

Memory Chart
Memory Chart

This is my first blog post, please share your feedback in the comment. Thank you 🙂