×

What is Cache Memory? Types of Cache Memory

Cache Memory in Computer

Cache memory is a semiconductor chip used to retrieve data from a computer's memory efficiently. Generally, cache memory is much costlier than main memory or any other disk memory. The cache memory acts as a buffer between RAM and CPU. It is more readily available for the processor than the main memory in the form of DRAM.

Sometimes, it is also known as CPU memory because it is directly integrated into the CPU or placed on a chip directly connected with the CPU. It means that the cache memory is significantly closer to the processor. Due to this, the processor can easily access the Cache memory.

It is smaller than the main memory and has less storage space than the main memory. However, the speed of the Cache memory is very fast. The rate of the cache memory is somewhere 10 to 100 times faster than the main memory.

Cache memory and the cache is two different terms. The cache is generally temporary storage in the form of the hardware or the software. But cache memory is a special hardware component that permits the computer to create cache at different levels.

Types of Cache Memory

Cache memory is divided in terms of the level that describe the closeness and accessibility to the processor. It is generally divided into three levels which are the following:

Level1: This level is also known as the primary cache. It is quite small in size, but it is extremely fast. It is generally integrated into the processor chip in the form of a CPU cache.

Level2: This level is also known as the secondary cache. Level 2 cache memory is bigger than Level1 in size. It may be integrated on a separate chip or coprocessor. It has a high-speed system bus, which is directly connected to the CPU. Due to this, it does not get slowed by the traffic on the main system bus.

Level3: It is the special memory that is developed to enhance the performance of Level1 and Level2. Level1 or Level2 can be significantly faster than Level3. However, the speed of Level3 is generally double the speed of DRAM. In the multi-core processor, each core has its individual Level1 and Level2 cache but can share Level3 cache.

Cache Performance:

The processor, before anything to read or write a location in the main memory, first check the following entry in the cache:

  • Whenever the processor finds that there is a memory location present in the cache, the cache hit will occur, and data will be accessible from the cache.
  • The cache miss will have occurred when the processor does not find the cache's memory location after validation. The cache will allocate a new entry and copies the data from the main memory for every cache miss. After this, the request is fulfilled from the contents of the cache.

Hit ratio: The hit ratio is the measurement quantity used to measure the cache memory's performance.  

Hit ratio = hit / (hit + miss) =  no. of hits/total accesses

The performance of the cache can be enhanced by using the following things:

  • The size of the block should be larger.
  • The associativity should be higher.
  • The miss rate should be less.
  • Avoid miss penalty
  • The time to hit the cache should be less.

Cache Mapping

The various cache memory mapping techniques are available below:

  • Direct mapping
  • Associative mapping
  • Set-Associative mapping.

1) Direct Mapping: It is the basic mapping technique. In this mapping technique, each block is mapped to only one cache memory location. In this mapping technique, each memory block has been assigned to a distinct line in the cache. If the line is previously taken up by any memory block when a new block needs to be loaded, the old block will be flogged. Address space will be divided into two parts: an index field and a tag field. The tag field is stored in the cache, and the main memory holds all the things that have been left. If the Hit ratio is good, the performance of this technique will be good. We can say that this mapping technique's performance directly depends on the Hit ratio.

2) Associative Mapping: In the associative mapping technique, associative memory is used to store content and addresses of the memory word. In this mapping technique, any block can occupy any line of the cache. Thus, the word id's bits are used to identify which word in the block is needed, but the tag becomes all of the remaining bits. It allows placing any word anywhere in the cache memory. It is the fastest and the most flexible mapping form.

3) Set-associative Mapping: The Set-associative Mapping technique can be viewed as the agreement between the previous two types of cache memory mapping technique. This mapping technique maps each block in the subset of the location of the cache. It is sometimes also known as the "N-way set associative mapping." It will permit a cache of any "N" location from the Level 1 cache in the main memory. The best of the direct cache mapping technique and associative cache mapping technique are grouped to form the set-associative cache mapping technique.


Related Topics

How to restart Microsoft Windows

Restarting resolves many errors and helps in running the windows smoothly, and if any new updates or new software is installed, restarting clears the memory and stops the tasks that...

4 minutes read.

What is VDU?

In this article, we shall discuss the VDU- visual display unit. VDU states visual display unit. This is a British term. And this is used to display pictures and text on...

4 minutes read.

What is Account Sharing?

Account sharing is the way of allowing multiple people to use a same account by sharing their username and password with others. For instance, to avoid having to pay for...

7 minutes read.

What is a Webcam?

Webcam is a peripheral digital camera that can be attached to the device, which allows you to click photos and record videos directly on the system. There is various webcam...

11 minutes read.

Who invented Computer?

Who invented Computer? I know this is the vert standard question which we have learned at standard 2. But, it’s not a surprise that most of the people fail to answer...

4 minutes read.

What is Hard Disk Drive (HDD)?

HDD is an electro-mechanical device that enables the user to store data for future use. The device has magnetic storage that is responsible for storing the information. And, this stored...

7 minutes read.

How much do Computer Programmers make?

With growing technology, people are working fast to pace up with the perpetual demand. Everything which has made our life easier and comfortable has something to do with computer engineering...

7 minutes read.

What is a bit (Binary Digit)?

A bit is the short form of Binary digit, which is the basic unit of information in computing and digital communications. It is a binary value, meaning it can have...

9 minutes read.

What is the Pg Dn Key (Page Down Key)

The Pg Dn key is a computer keyboard key located on the numeric pad number 3 or between the keyboard and the numeric keypad. It can also be referred to...

2 minutes read.

Computer: CPU (Central Processing Unit)

What is CPU? Explain its block Diagram The Central Processing Unit is known as the central processor or main processor. The CPU is an electronic circuitry within the computer which can...

5 minutes read.

What is open with?

You can open a file with your chosen program by using Windows' Open With function. The software that opens those files may not be the normal Windows program. When you...

3 minutes read.

What is Access Time?

Access time is when a computer can recover data from a storage device, such as a hard drive or solid-state drive. It is an important factor that can affect the...

7 minutes read.

How to Connect and Install a Computer Keyboard?

The wired keyboards used nowadays are linked to the computer using the USB interface. The older computers used the Personal System/2(PS/2), also called the mouse or keyboard port, to connect...

7 minutes read.

Parts of Computers Names, Definitions and Images

Computer: A computer is an electronic device, which is made up of using various hardware. The computer processes data, performs calculations, and communicates with other devices and systems. Hardware refers...

14 minutes read.

History of Computers

You might think just like there were no computers available in ancient times, no people can know about computers, but at that time, they had to calculate and compute by...

6 minutes read.

What is RDIMM?

Servers use the RDIMM (registered memory) kind of memory chip most frequently. By reducing the electrical strain on a memory controller, it helps systems running on a server be more...

3 minutes read.

What is Hybrid Topology?

A hybrid topology is also called network topology. Topology can be defined as the physical and logical arrangements of computer networks. We can say that topology is nothing, but how...

6 minutes read.

What is a Slide?

A slide is typically a single page of a presentation or lecture. Slides are usually used to present information visually, using text, images, charts, and other media to convey ideas...

4 minutes read.

What is Data?

In our daily life, you can see everybody is dealing with information and data to analyze things. Data can be of different forms and can be converted to the required...

6 minutes read.

What is Borderless Printing?

Borderless printing is a printing method that allows a printer to print an image or document without any margins or borders. This means that the image or document is printed...

8 minutes read.