When someone tries to buy or assemble a new computer,
of course, he will search for the specifications of a suitable processor for
him. When asked about the specifications of the processor, the person from whom
you buy tells you that this processor contains a cache memory of 4 megabytes,
for example. Of course, most of us are not aware of the importance of cache
memory or cache memory and choose the professor who has a higher memory cache
only without understanding its importance for that. The cache memory is
sometimes divided into 3 levels: Level 1, Level 2, and Level 3 in most
processors. Also, when you check the capabilities of your device with the CPU-z
program, for example, and you find that it tells you that the cache memory is
L1, L2, and L3, today we will explain to you in a very easy and simple way, as
usual, what is the difference between these the three levels of cache memory.
What is cache memory?
Cache Memory is simply similar to RAM, but its size is
smaller and faster to deal with the processor than the RAM, and it is located
inside the processor, so it is closer to the processor than normal RAM, and you
know that the data and information of the programs that you run on your
computer are stored in the RAM and the processor By calling it when needed, but
it is the habit of every person in us to open a program or several programs
more than any other program, that is, you open it constantly, and in this case,
the role of the cache memory appears, which stores the information of those
programs that you use constantly so that it is easy for the processor to recall
it quickly It is larger than any other program, so it is faster than RAM, but
it is less in size, so it stores only a few data and programs inside it, and
this memory is divided into 3 levels, so let us know more clearly about the
difference between these three levels in the cache memory.
to imagine...
Imagine that there is an employee in one of the
government offices and he sits on a desk full of papers around him, and there
are many, many papers around him and everywhere, and in the office, he sits on
there is a drawer carrying a group of papers, and behind this employee, you see
a cupboard that contains another larger group of papers, who knows What date do
these papers date back to?
And now you go to this employee and then ask him,
"Can I get a paper that belongs to me in the name of" ABTC "-
for example-- and here he will tell you, do you mean ABCT? Well, I saw it
somewhere here on the table, then he searches through the 64 papers placed on
the desk Then he picks up a paper and feels that he has finally found it, then
he looks closely again and bemoans his luck to tell you that the paper belongs
to ABC and not to ABC and tells you that he is sorry and that he made a mistake
and you have to wait a little while until he remembers its exact location, then
he opens the desk drawer in front of him and takes out a bundle of paper
consisting of Of 512 cards, then he puts them on the table and begins to search
through them, and after two minutes he tells you, "Sir, the paper is not
here either." Perhaps it would be better for you to come tomorrow,"
but you tell him that it is urgent and necessary today, then he looks at you
narrowly and takes the decision and goes to the cupboard behind him and opens
it, and flips through a group of 8000 cards, then he comes with a paper and
tells you that this may be your required paper, and if it is not, then you
should So go to the back room and search for your paper among 2 million
papers!! You look at the paper in your hand..you are happy that it is it and you
do not have to search among 2 million papers and then take it and run away
before the employee calls you again.
Conclusion and point of the story.
Well, I can tell you that the employee is the
processor, and the space on the table that can hold 64 (kilobytes) of paper and
is close to the employee and in which he can search faster than others is the
first level of the L1 Cache memory. As for the space in the desk drawer that
can Download 512 (kilobyte) sheets, which take a little more time to search through,
which is the second level of the L2 cache. The cupboard located behind the
employee, which contains the largest capacity in this room (8000 KB),
represents the third level of cache memory, L3 Cache. The back room, in which
the largest amount of paper (2 GB) is stored, is the RAM.
The technical concept of that story
The first level, the second level, and the third level
of cache memory is similar to the RAM memory in a computer. These levels have
been built to reduce the time it takes the processor to process the required
data and operations. As for the installation of these levels, it differs
slightly between each level and the other. The first level, for example, was
designed using larger transistors and wider metal paths and circuits to convert
energy and those wide areas into a faster speed in dealing with operations. The
device and higher levels are narrower and use smaller transistors.
There are more complications in this story, such as
the fact that the third level of cache memory has its own chip in some
processors, and more than one processor can search for information in this
level, and the speed of accessing information in these levels usually takes
some nanoseconds and generally does not represent a big difference For the
average user, but computer scientists and programmers who develop and program
programs that deal with a lot of operations and information are interested in
this matter, and this difference in speed may represent days or even months for
them.
Conclusion.
The cache memory is the first thing the processor resorts to when executing a process on the computer in order to obtain its information, especially the first level of the L1 cache memory, which is the smallest in size among the three levels (2 - 64 kilobytes), so it saves only the most important information, but it is also the fastest of those The levels are because they are closest to the processor. By moving to the second level, L2, we find that it is slightly larger in size (256-512 kilobytes) to carry a larger amount of information, but it is slightly slower than the first level, but in any case, it is faster than the third level, L3, which is the largest of them in size (1- 8 MB), but it is often in a segment a little further than the processor, so it is the slowest of those levels. Despite that, it is much faster than the RAM memory that the processor resorts to when it does not find what it needs in those levels. Of course, the RAM is larger in size than the cache memory. When looking at The largest of all, we find the hard disk, which is considered the last station that the processor reaches in the process of storing information, especially in the paging file, and I do not have to tell you that it is very slow in terms of processing information. Just a tip.. :)