0% found this document useful (0 votes)
16 views6 pages

Split Presentations 1

Cache memory is a small, high-speed RAM buffer that stores copies of instructions and data currently in use by the CPU to enhance computer performance. It operates with different mapping techniques, including direct mapping, associative mapping, and set associative mapping, each with unique methods for accessing stored data. The hit ratio is a key metric, representing the effectiveness of cache memory by comparing successful data accesses to total memory accesses.

Uploaded by

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

Split Presentations 1

Cache memory is a small, high-speed RAM buffer that stores copies of instructions and data currently in use by the CPU to enhance computer performance. It operates with different mapping techniques, including direct mapping, associative mapping, and set associative mapping, each with unique methods for accessing stored data. The hit ratio is a key metric, representing the effectiveness of cache memory by comparing successful data accesses to total memory accesses.

Uploaded by

pailaprasanna315
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
CACHE MEMORY What is Cache Memory? © Cache memory is a small, high-speed RAM buffer located between the CPU and main memory. © Cache memory holds a copy of the instructions (instruction cache) or data (operand or data cache) currently being used by the CPU. © The main purpose of a cache is to accelerate your computer while keeping the price of the computer low. Placement of Cache in computer '! ‘Magnetic Disk . Main ‘Memory ‘Magnetic = cache ou Memory =) Hit Ratio © The ratio of the total number of hits divided by the total CPU accesses to memory (i.e. hits plus misses) is called Hit Ratio. ® Hit Ratio = Total Number of Hits / (Total Number of Hits + Total Number of Miss) Types of Cache Mapping |. Direct Mapping 2. Associative Mapping 3. Set Associative Mapping 1. Direct Mapping The direct mapping technique is simple and inexpensive to implement, When the CPU wants to access data from memory, it places a address, The index field of CPU address is used to access address. The tag field of CPU address is compared with the associated tag in the word read from the cache If the tag-bits of CPU address is matched with the tag-bits of cache, then there isa his and the required data word is read from cache I there is no match, then there is a miss and the required data word is stored in main memory. It is then transferred from main memory to cache memory with the new tag. c 1. Direct Mapping 6bits sits t Index 00 000 octal dress nm Ce | 32K 12 Main Memory Address=15 bits Data=12bits 00 octal address ™ 12x12 Cache Memory Address= 9 bits Data= 12 bits 1. Direct Mapping Main Memory Asides ata 00 000 5670 oT or 000 al oT 3321 oF 125 782 aad 5432 Cache Memory Index Taga [000 [0 | 5670 mm | oo | 7523 ooo [or | 1256 ns | st | seo am [a | si 2. Associative Mapping ® An associative mapping uses an associative memory. © This memory is being accessed using its contents. ® Each line of cache memory will accommodate the address (main memory) and the contents of that address from the main memory. © That is why this memory is also called Content Addressable Memory (CAM). It allows each block of main memory to be stored in the cache. 2. Associative Mapping oE Address Data Adéeess Data 1aso7_] 303 |_ ——_[aaser_| 303 (sie [2473 273 sesso | 2588 ae pee | at Il 2 cm 31567 | 0256 sa aa I Tasee AcrocaiveCache Memory \\ <= AN \ sures [sta mis | 9a ‘Main Memory 3. Set Associative Mapping © That is the easy control of the direct mapping cache and the more flexible mapping of the fully associative cache. © In set associative mapping, each cache location can have more than one pair of tag + data items. © That is more than one pair of tag and data are residing at the same location of cache memory. If one cache location is holding two pair of tag + data items, that is called 2-way set associative mapping. 3. Two-Way Set Associative Mapping Main Memory Cache Memory Address Dat 000 | 5670 01 000) 01666 | 531 a] se | on [a] 0 ors | 732 7) se) om [we] ae nim | sa

You might also like