Cache Memory PDF
Document Details
Uploaded by FreshestOboe9465
SUST
Tags
Summary
This document discusses various aspects of cache memory, including its characteristics, hierarchy, structure, operation, and replacement algorithms. It also touches upon locality of reference and different mapping functions associated with cache memory.
Full Transcript
Cache Memory Memory Characteristics Memory Hierarchy - Diagram Memory Hierarchy Registers – In CPU Internal or Main memory – cache – RAM External memory – Backing store Hierarchy List Registers L1 Cache L2 Cache Main memory Disk Optical...
Cache Memory Memory Characteristics Memory Hierarchy - Diagram Memory Hierarchy Registers – In CPU Internal or Main memory – cache – RAM External memory – Backing store Hierarchy List Registers L1 Cache L2 Cache Main memory Disk Optical Tape Locality of Reference During the course of the execution of a program, memory references tend to cluster e.g. Loops, Subroutines, and Arrays. Cache Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module Cache/Main Memory Structure Cache operation - overview CPU requests contents of memory location Check cache for this data If present, get from cache (fast) If not present, read required block from main memory to cache Then deliver from cache to CPU Cache/Main Memory Structure – Main memory : n consists of up to 2 addressable words, with each word having a unique n-bit address. For mapping purposes, this memory is divide to M blocks, as number of nfixed-length is K words for 2 each block. K M= Cache/Main Memory Structure Cache Memory : Cache consists of m blocks called lines.Each line contains K words, plus a tag of a few bits to identify which block of main memory is in n each cache 2 slot. m =K The number of lines is considerably less than the number of main memory blocks (m