0% found this document useful (0 votes)
32 views

Cache Memory

Cache memory is a high-speed memory located close to the CPU that stores frequently accessed data. It acts as a buffer between the CPU and RAM to speed up access times. Cache memory is more expensive than RAM but cheaper than CPU registers. It holds recently used data and instructions so they are immediately available to the CPU when needed to improve performance.

Uploaded by

shinyshiny966
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Cache Memory

Cache memory is a high-speed memory located close to the CPU that stores frequently accessed data. It acts as a buffer between the CPU and RAM to speed up access times. Cache memory is more expensive than RAM but cheaper than CPU registers. It holds recently used data and instructions so they are immediately available to the CPU when needed to improve performance.

Uploaded by

shinyshiny966
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

● Cache Memory is a special very high-speed memory.

● It is used to speed up and synchronizing with high-speed CPU.


● Cache memory is costlier than main memory or disk memory but
economical than CPU registers.
● Cache memory is an extremely fast memory type that acts as a buffer
between RAM and the CPU.
● It holds frequently requested data and instructions so that they are
immediately available to the CPU when needed.

Simple Cache Representation


Cache Mapping
FORMULA FOR MAPPING:

ACCESSING 22,26,22,26,16,3,16,18,16
Key points of Direct Mapping
❖ In Direct mapping, assign each memory block to a specific line in the
cache.
❖ If a line is previously taken up by a memory block when a new block
needs to be loaded, the old block is trashed.
❖ An address space is split into two parts index field and a tag field. The
cache is used to store the tag field whereas the rest is stored in the
main memory.
❖ Direct mapping`s performance is directly proportional to the Hit ratio.

Need of Tag bits and Valid bits


1. The tags contain the address information required to identify whether a
word in the cache corresponds to the requested word.
2. Valid bit used to indicate whether an entry contains a valid address. If the
bit is not set, there cannot be a match for this block.

Handling Writes
1. Write-through - The simplest way to keep the main memory and the
cache consistent is always to write the data into both the memory and the
cache.
2. Write Back- when a write occurs, the new value is written only to the
block in the cache. The modified block is written to the lower level of the
hierarchy when it is replaced. Write-back schemes can improve
performance.

Types of Cache Memory:


L1: It is the first level of cache memory, which is called Level 1 cache or L1 cache. In
this type of cache memory, a small amount of memory is present inside the CPU
itself.

L2: This cache is known as Level 2 cache or L2 cache. This level 2 cache may be
inside the CPU or outside the CPU. All the cores of a CPU can have their own
separate level 2 cache, or they can share one L2 cache among themselves.

L3: It is known as Level 3 cache or L3 cache. This cache is not present in all the
processors; some high-end processors may have this type of cache.
How does cache memory work with CPU?
When CPU needs the data, first of all, it looks inside the L1 cache. If it does not find
anything in L1, it looks inside the L2 cache. If again, it does not find the data in L2
cache, it looks into the L3 cache. If data is found in the cache memory, then it is
known as a cache hit. On the contrary, if data is not found inside the cache, it is
called a cache miss.

If data is not available in any of the cache memories, it looks inside the Random
Access Memory (RAM). If RAM also does not have the data, then it will get that data
from the Hard Disk Drive.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy