lecture 8 memory hierarchy - philadelphia university
TRANSCRIPT
![Page 1: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/1.jpg)
Lecture٨-ACA١
Advanced Computer Architecture(0630561)
Lecture 8
Memory HierarchyProf. Kasim M. Al-Aubidy
Computer Eng. Dept.
![Page 2: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/2.jpg)
Lecture٨-ACA٢
Introduction:
![Page 3: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/3.jpg)
Lecture٨-ACA٣
![Page 4: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/4.jpg)
Lecture٨-ACA٤
![Page 5: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/5.jpg)
Lecture٨-ACA٥
Levels of the Memory Hierarchy:
![Page 6: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/6.jpg)
Lecture٨-ACA٦
![Page 7: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/7.jpg)
Lecture٨-ACA٧
Memory Hierarchy Properties:• Information stored in a memory hierarchy (M1, M2,..Mn)
satisfies three important properties:• Inclusion Property: it implies that all information items are
originally stored in level Mn. During the processing, subsetsof Mn are copied into Mn-1. similarity, subsets of Mn-1 arecopied into Mn-2, and so on.
• Coherence Property: it requires that copies of the sameinformation item at successive memory levels be consistent.If a word is modified in the cache, copies of that word mustbe updated immediately or eventually at all higher levels..
• Locality of References: the memory hierarchy wasdeveloped based on a program behavior known as locality ofreferences. Memory references are generated by the CPUfor either instruction or data access. Frequently usedinformation is found in the lower levels in order to minimizethe effective access time of the memory hierarchy.
![Page 8: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/8.jpg)
Lecture٨-ACA٨
![Page 9: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/9.jpg)
Lecture٨-ACA٩
Memory Capacity Planning:• The performance of a memory hierarchy is determined by
the effective access time (Teff) to any level in the hierarchy. Itdepends on the hit ratio and access frequencies atsuccessive levels.
• Hit Ratio (h): is a concept defined for any two adjacentlevels of a memory hierarchy. When an information itemfound in Mi, it is a hit, otherwise, a miss. The hit ratio (hi) atMi is the probability that an information item will be found inMi. the miss ratio at Mi is defined as 1-hi.
• The access frequency to Mi is defined asfi= (1-h1)(1-h2)….(1-hi)
![Page 10: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/10.jpg)
Lecture٨-ACA١٠
Effective Access Time (Teff):• In practice, we wish to achieve as high a hit ratio as possible at M1. Every
time a miss occurs, a penalty must be paid to access the next higher levelof memory.The Teff of a memory hierarchy is given by:
Hierarchy Optimization:The total cost of a memory hierarchy is estimated as:
![Page 11: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/11.jpg)
Lecture٨-ACA١١
Example:Consider the design of a three-level memory hierarchy with the followingspecifications for memory characteristics:
The design goal is to achieve an effective memory access time (t=10.04µs) with a cache hit ratio (h1=0.98) and a main memory hit ratio (h2=0.9).The total cost of memory hierarchy is limited by $15000.
Solution:Memory cost is calculated by;
Ctotal= C1S1+C2S2+C3S3 ≤ 15000, then S3=39.8The effective memory access time is calculated as
Teff=h1t1+(1-h1)h2t2+(1-h1)(1-h2)h3t3 ≤ 10.04, then t2= 903 ns.Note: If one wants to double the main memory to 64 Mbytes at the expense of
reducing the disk capacity under the same budget limit. This change will notaffect the cache hit ratio. But it may increase the hit ratio in the main memory if aproper page replacement algorithm is used.
![Page 12: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/12.jpg)
Lecture٨-ACA١٢
Cache Algorithm:
![Page 13: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/13.jpg)
Lecture٨-ACA١٣
Cache Memory:
![Page 14: Lecture 8 Memory Hierarchy - Philadelphia University](https://reader031.vdocument.in/reader031/viewer/2022021120/6205d7e048ad82228279ac29/html5/thumbnails/14.jpg)
Lecture٨-ACA١٤
Cache Memory: