0% found this document useful (0 votes)
14 views4 pages

Coa CACHE MEMORY

Uploaded by

Hemant Tank
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)
14 views4 pages

Coa CACHE MEMORY

Uploaded by

Hemant Tank
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 in Computer

Organization
Pre-Requisite: Computer Memory
Cache Memory is a special very high-speed
memory. The cache is a smaller and faster
memory that stores copies of the data from
frequently used main memory locations. There
are various different independent caches in a
CPU, which store instructions and data. The
most important use of cache memory is that it
is used to reduce the average time to access
data from the main memory.
Cache Mapping
There are three different types of mapping used
for the purpose of cache memory which is as
follows:

" Direct Mapping


" Associative Mapping
" Set-Associative Mapping

1. Direct Mapping

The simplest technique, known as direct


mapping, maps each block of main memory into
only one possible cache line. or 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 máin
memory. Direct mapping's performance is
directly proportionalto the Hit ratio.
i = /modulo m
where

i =cache line number


j =main memory block number
m = number of lines in the cache

Main
Tag Word-offset
Memory

Cache
Tag Line-offset Word-offset
Memory
(c) What is cache memory? Interpret direct addressing mapping with
diagram.

Cache memory is a high-speed memory that stores frequently used data or


instructions, allowing for faster access than retrieving from the main memory.
Direct addressing mapping is a cache mapping technique where each block in
the main memory is mapped to exactly one block in the cache memory.

In direct addressing mapping, the address of the data or instruction is divided


into three parts: the tag, the index, and the offset. The tag is used to identify
which block in the main memory the data or instruction is located in. The
index is used to determine which block in the cache memory the data or
instruction is mapped to. The offset is used to determine the exact location of
the data or instruction within the block.

The following diagram illustrates the direct addressing mapping technique for
a cache memory with 4 blocks and a block s0ze of 4 words:

Tag Line Number Block Offset

Sending tag of selected line


Read

tag Selected Line

tag

tag
Multiplexers
tag

Cache Memory

Comparator

Tag from the multiplexer

Result Direct Mapping

You might also like