Cache Memory Explained

Hey friends, Welcome to the YouTube channel
ALL ABOUT ELECTRONICS. So, in this video we will understand, what
is cache memory in computers and laptop. So, in this video, we will see what is the
importance of this cache memory, what is a typical size of this cache memory and what
are the different levels of cache memory that we find inside the computers. So, before we understand this cache memory,
let’s see different kind of memory that we see inside our computers. So, the first kind of memory that we find
inside our computer is the non-volatile kind of memory. Like a hard disk drive. So, this hard disk drive contains mechanically
rotating fast disk, which is also known as platters. And if you see any commercially available
hard disk drive, the typical rotating speed of the disk is either 5400 or 7200 RPM. So, as this hard disk drive contains a mechanically
rotating part, so in terms of the speed, they are quite slow. So, the typical read or write speed that you
get with this hard disk drive is in the range of 80 to 150 MBPS. But if you see the clock speed of the CPU,
it is in the range of 1GHz up to the 4 GHz. So, even though the processor is capable of
accepting a data much higher speed, but it can’t get the data through this hard disk
drive at the same rate. And that is where this second kind of memory
comes into the picture. That is Random Access Memory. Now, this Random Access Memory is faster compared
to the hard disk drive. So, this RAM can provide data to the CPU at
a much faster rate compared to the Hard disk drive. But still, it slower than the clock speed
of the CPU. So, the typical speed of the RAM is in the
range of 400 MHz up to the 800 MHz. Still, it is slower than the clock speed of
the CPU. But if you see the newer generations of the
RAM like DDR3 and DDR4, then they can operate at much faster rate like 1600 MHz or up to the
2100 MHz. So, now if you see the speed of this RAMs,
they are comparable to the speed of the CPU. Now, you may say that this newer version of
RAM can supply data to the CPU at the rate at which they want. But the answer is no. So, the modern day processors which we are
using is not single core processor but they are multicore processors. So, this processor could be either dual core,
quad core or maybe even octa core. So, if all the cores are asking for data at
the same time, then this RAM can’t be able to deliver the data to all the cores at the
same time. And that is where this cache memory comes
into the picture. So, this cache memory is fastest among all
memories. So, this cache memory is also Random Access
Memory but it is special kind of RAM, which is known as Static RAM. So, unlike the Dynamic RAM, which we find
inside the normal RAM, this static RAM is quite fast. And the typical size of this cache memory
is in the range of Kilo Bytes up to the Few Mega Bytes. So, the data which is frequently required
by the CPU can be supplied by this cache memory. So, generally, some instructions and data
which is required by the CPU are stored in this cache memory. So, now let’s see the different levels of
this cache memory. The first level of a cache memory is known
as Level 1 cache or L1 cache. So, in this level 1 cache, tiny amount of
memory is integrated inside the CPU itself. And all the cores inside CPU have their individual
level 1 cache. So, as this level 1 cache integrated inside
the CPU, so they can operate at the same speed of the CPU. And that is the reason, level 1 cache is fastest
among all caches. Now, the typical memory size of this level
1 cache is 2KB up to the 64 KB. Now inside this level 1 cache, there is two
kind of cache. The one is instruction cache and the second
is data cheche. So, the instruction cache stores all instructions
which are required by the CPU and the data cache stores the data which is required by
the CPU. Now, let’s see the second level of cache. So, this cache is known as either Level 2
cache or L2 cache. Now, this level 2 cache could be either inside
the CPU or it could be outside the CPU. Now, this level 2 cache could be separate
for all the cores or it could be shared between all cores of the CPU. So, if this level 2 cache is outside the CPU,
then it is connected with a very high-speed bus with the CPU. So, the memory size of this level 2 cache
is in the range of 256 KB to the 512 KB. But in terms of the speed, they are slower
than the L1 cache. Now, the third kind of cache is known as Level
3 cache. So, all the processors do not have this level
3 cache, but some higher end processors have this level 3 cache. And this level 3 cache is used to enhance
the performance of this level 1 and level 2 cache. So, now this level 3 cache is shared among
all cores. And it is outside the CPU. The memory size of this level 3 cache is in
the range of 1 MB up to the 8 MB for high end processors. But it is slower than the L1 and L2 cache. But still, it is faster than the Random Access
Memory or RAM. So, now let’s see the process flow when CPU
needs some data. So, whenever CPU needs some data then, first
of all, it will look inside the L1 cache. So, if it will not find inside the L1 cache
then it will look inside the L2 cache. And if data is inside the L2 cache then it
will look into the L3 cache. So, if CPU finds the data inside the cache
memory then it is known as a cache hit. But if data is not unavailable inside the
cache then it is known as a cache miss. Suppose if data is not available in the L3
cache, the CPU will look inside the Random Access Memory or RAM. And still, if it doesn’t find any data inside
the RAM then it will get that data from the Hard Disk Drive. So, when you are starting your computer for
the first time or you are opening some application for the first time, then that data will not
be available in either cache memory or in RAM. So, at that time CPU will get that data from
the hard disk drive. But, once the application is open and then
after if it requires some data then CPU will get that data from either RAM or cache memory. Now, you may ask that if this cache memory
is so fast then why the size of this cache memory is only in Mega Bytes. So, the reason is that this cache memory is
much much costlier than the other memories. And that is the reason you find only a few
Mega Bytes of cache memory inside the CPU. So, whenever you are buying some desktop or
laptop for yourself, don’t only look the Random Access memory but also look how much cache
memory that CPU has. Because this cache memory decides the overall
performance of the processor. And the same thing is applicable for the smartphone
processors as well. So, I hope in this video you understood, what
is cache memory and what is the significance of this cache memory inside
the computers.

Glenn Chapman


  1. Don't say the data speed in caps i.e say as Mbps (megabit per second) and not as MBPS (megabytes per second)

  2. Very wonderful explanation.
    Can you please make videos on internal memory and external memory in detail according to Computer Organisation and Architecture

  3. very nice….concept is fully clear
    .. plz deliver a video on osi model plz

  4. very nice….concept is fully clear
    .. plz deliver a video on osi model plz

  5. Excellent… It contained such facts that no channel usually explain or shows

  6. Amazing presentation with well explained manner.. thanks buddy for this video.

  7. Hello Sir, Please tell which mile do you use, and which software for making this type of videos

  8. Do idians ever speak english clear and comprehensibly?!?! I can't understand a thing of what he says! That sucks!

  9. Why do we write cache memory and sram apart or it is wrong to write?

  10. Very nice bro! You added subtitles. Thanks a lot xD

  11. sir
    yr video on CACHE MEMORY EXPLAINED IN english Is outstanding as u explained ever thing i wanted to ask and know about it.
    u are not only a brillient COMPUTER expert but also AN outstanding TEACHER.
    U desrve all our appreciation and admiration.
    s.vatsa, Bangalore

  12. Brother.I got Digital system design as my subject.
    Could you please make a tutorial over it…

  13. These videos are really helpful and also very informative for electronics students.Thank you .please keep doing these type of videos.

  14. U said that if we open any site for 2nd time,then it will access the data from cache or RAM.As the memory of cache is very small how can it store that data???

  15. Great lecture.Everything is explained in a lucid manner.
    Every bit is well connected which enhanced the flow of lecture.
    Can you please make a course on microprocessors?

  16. Thank you for the English subtitles, I have trouble with accents so it helped a lot.

  17. At initial stage, I got noting. But as the video moved furthur, I get what u were tryna explain. Excellent Job !!

  18. awesome!! Loved your original Indian accent… Please do not try to act like wannabe Americans.. your accent is your originality.

  19. I understand that RAM is slower than cache because it has to keep refreshing. So does refreshing mean retrieving from the hard drive? If so isn't the point of memory to avoid having to keep accessing the slower hard drive? Thanks

  20. I have asus k50ip and i want to buy pentium on 3.3 ghz but the pentium have 0.5 cache and my intel is 2.1 ghz and 2 cache i need ghz or cache

  21. You try to help people out but they criticize you for your accent.
    Bunch of ungrateful fucks.
    Your video was brilliant man, I understood everything you said.
    Thank you.

  22. Useful presentation …….thanks a lot and also expecting more from you

  23. Can we say every data instruction comes to CPU via cache memory only

  24. The accent made it difficult, however, there are subtittles! 😀 So thanks for your explanation!

  25. if a variable is saved in cache then is it also available in RAM??

  26. You really don't need that 20 second intro.
    Other than that great video.

  27. L2 or L3 was motherboard depedent in old days.

    Today most CPU (Computer/Mobile) Comes with all the caches L1 L2 L3 in same CPU die or CPU itself.

  28. I m confused between which laptop to buy. One has 120hz display but has 6mb cache while other one has 8mb cache 60hz display

  29. EXCELLENT video. Simplified but not dumbed down so much that I feel like I need to fast forward. Thank you!

  30. Normally, I need to listen to 2-3 videos on a single subject in order to understand it and be able to explain it to someone else, but I do not need to do that here! Thank you so much for this helpful video. It was very informative!!!

  31. Bro is that cache memory give better performance in gaming ?? Like I mean FPS can be stable in gaming sessions… And No lag at all smooth only while is playing ? TQ for replying and your explanation is superb bro… 👍👍👍

  32. Excellent explanation. I looked some videos regarding the L3 Cache and this was by far the best one, it should be the top of the search. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *