Maninder Kaur CACHE MEMORY 24-Nov-2010 1

Slides:



Advertisements
Similar presentations
SE-292 High Performance Computing
Advertisements

Cache and Virtual Memory Replacement Algorithms
361 Computer Architecture Lecture 15: Cache Memory
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
1 Cache and Caching David Sands CS 147 Spring 08 Dr. Sin-Min Lee.
Lecture 8: Memory Hierarchy Cache Performance Kai Bu
Cache Definition Cache is pronounced cash. It is a temporary memory to store duplicate data that is originally stored elsewhere. Cache is used when the.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
1 Recap: Memory Hierarchy. 2 Memory Hierarchy - the Big Picture Problem: memory is too slow and or too small Solution: memory hierarchy Fastest Slowest.
Cache Memory Locality of reference: It is observed that when a program refers to memory, the access to memory for data as well as code are confined to.
On-Chip Cache Analysis A Parameterized Cache Implementation for a System-on-Chip RISC CPU.
Processor - Memory Interface
Overview of Cache and Virtual MemorySlide 1 The Need for a Cache (edited from notes with Behrooz Parhami’s Computer Architecture textbook) Cache memories.
Chapter IX Memory Organization CS 147 Presented by: Duong Pham.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class CachesCaches Direct mapped cacheDirect mapped cache Set associative.
Cache Memories Effectiveness of cache is based on a property of computer programs called locality of reference Most of programs time is spent in loops.
COEN 180 Main Memory Cache Architectures. Basics Speed difference between cache and memory is small. Therefore:  Cache algorithms need to be implemented.
Unit-4 (CO-MPI Autonomous)
Maninder Kaur VIRTUAL MEMORY 24-Nov
Memory Systems Architecture and Hierarchical Memory Systems
Memory Hierarchy and Cache Memory Jennifer Tsay CS 147 Section 3 October 8, 2009.
Lecture 10 Memory Hierarchy and Cache Design Computer Architecture COE 501.
Chapter Twelve Memory Organization
How to Build a CPU Cache COMP25212 – Lecture 2. Learning Objectives To understand: –how cache is logically structured –how cache operates CPU reads CPU.
10/18: Lecture topics Memory Hierarchy –Why it works: Locality –Levels in the hierarchy Cache access –Mapping strategies Cache performance Replacement.
CSIT 301 (Blum)1 Cache Based in part on Chapter 9 in Computer Architecture (Nicholas Carter)
Computer Architecture Memory organization. Types of Memory Cache Memory Serves as a buffer for frequently accessed data Small  High Cost RAM (Main Memory)
L/O/G/O Cache Memory Chapter 3 (b) CS.216 Computer Architecture and Organization.
Computer Architecture Lecture 26 Fasih ur Rehman.
3-May-2006cse cache © DW Johnson and University of Washington1 Cache Memory CSE 410, Spring 2006 Computer Systems
1 Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: –illusion of having more physical memory –program relocation.
Multiprocessor cache coherence. Caching: terms and definitions cache line, line size, cache size degree of associativity –direct-mapped, set and fully.
2007 Sept. 14SYSC 2001* - Fall SYSC2001-Ch4.ppt1 Chapter 4 Cache Memory 4.1 Memory system 4.2 Cache principles 4.3 Cache design 4.4 Examples.
CSE 241 Computer Engineering (1) هندسة الحاسبات (1) Lecture #3 Ch. 6 Memory System Design Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Lecture 08: Memory Hierarchy Cache Performance Kai Bu
COMP SYSTEM ARCHITECTURE HOW TO BUILD A CACHE Antoniu Pop COMP25212 – Lecture 2Jan/Feb 2015.
DECStation 3100 Block Instruction Data Effective Program Size Miss Rate Miss Rate Miss Rate 1 6.1% 2.1% 5.4% 4 2.0% 1.7% 1.9% 1 1.2% 1.3% 1.2% 4 0.3%
Caches Hiding Memory Access Times. PC Instruction Memory 4 MUXMUX Registers Sign Ext MUXMUX Sh L 2 Data Memory MUXMUX CONTROLCONTROL ALU CTL INSTRUCTION.
Chapter 9 Memory Organization By Nguyen Chau Topics Hierarchical memory systems Cache memory Associative memory Cache memory with associative mapping.
Cache Memory Chapter 17 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S. Dandamudi.
11 Intro to cache memory Kosarev Nikolay MIPT Nov, 2009.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
Lecture 20 Last lecture: Today’s lecture: Types of memory
Cache Memory By Ed Martinez.  The fastest and most expensive memory on a computer system that is used to store collections of data.  Uses very short.
CAM Content Addressable Memory
Cache Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module.
Cache memory Replacement Policy Prof. Sin-Min Lee Department of Computer Science.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Cache Memory.
Characteristics Location Capacity Unit of transfer Access method Performance Physical type Physical characteristics Organisation.
Chapter 9 Memory Organization. 9.1 Hierarchical Memory Systems Figure 9.1.
Computer Orgnization Rabie A. Ramadan Lecture 9. Cache Mapping Schemes.
Computer Architecture Lecture 25 Fasih ur Rehman.
Associative Mapping A main memory block can load into any line of cache Memory address is interpreted as tag and word Tag uniquely identifies block of.
Cache Memory Yi-Ning Huang. Principle of Locality Principle of Locality A phenomenon that the recent used memory location is more likely to be used again.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Cache Memory.
CAM Content Addressable Memory
Multilevel Memories (Improving performance using alittle “cash”)
Cache Memory Presentation I
Consider a Direct Mapped Cache with 4 word blocks
William Stallings Computer Organization and Architecture 7th Edition
Module IV Memory Organization.
Chapter 6 Memory System Design
Chap. 12 Memory Organization
Presentation transcript:

Maninder Kaur CACHE MEMORY 24-Nov

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. 24-Nov

Placement of Cache in computer 24-Nov

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) 24-Nov

Example 24-Nov A system with 512 x 12 cache and 32 K x 12 of main memory.

Types of Cache Mapping 1. Direct Mapping 2. Associative Mapping 3. Set Associative Mapping 24-Nov

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 is a hit and the required data word is read from cache. If 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. 24-Nov

1. Direct Mapping 24-Nov

1. Direct Mapping 24-Nov

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. 24-Nov

2. Associative Mapping 24-Nov

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. 24-Nov

3. Two-Way Set Associative Mapping 24-Nov

Replacement Algorithms of Cache Memory Replacement algorithms are used when there are no available space in a cache in which to place a data. Four of the most common cache replacement algorithms are described below: Least Recently Used (LRU): The LRU algorithm selects for replacement the item that has been least recently used by the CPU. First-In-First-Out (FIFO): The FIFO algorithm selects for replacement the item that has been in the cache from the longest time. Least Frequently Used (LRU): The LRU algorithm selects for replacement the item that has been least frequently used by the CPU. Random: The random algorithm selects for replacement the item randomly. 24-Nov

Writing into Cache When memory write operations are performed, CPU first writes into the cache memory. These modifications made by CPU during a write operations, on the data saved in cache, need to be written back to main memory or to auxiliary memory. These two popular cache write policies (schemes) are: Write-Through Write-Back 24-Nov

Write-Through In a write through cache, the main memory is updated each time the CPU writes into cache. The advantage of the write-through cache is that the main memory always contains the same data as the cache contains. This characteristic is desirable in a system which uses direct memory access scheme of data transfer. The I/O devices communicating through DMA receive the most recent data. 24-Nov

Write-Back In a write back scheme, only the cache memory is updated during a write operation. The updated locations in the cache memory are marked by a flag so that later on, when the word is removed from the cache, it is copied into the main memory. The words are removed from the cache time to time to make room for a new block of words. 24-Nov

18 16-Aug-15