Cache Memory Exercises. Questions I Given: –memory is little-endian and byte addressable; memory size; –number of cache blocks, size of cache block –An.

Slides:



Advertisements
Similar presentations
Practical Caches COMP25212 cache 3. Learning Objectives To understand: –Additional Control Bits in Cache Lines –Cache Line Size Tradeoffs –Separate I&D.
Advertisements

Network exercise (P2) Consider the PERT/CPM network shown below. D A 2
© Karen Miller, What do we want from our computers?  correct results we assume this feature, but consider... who defines what is correct?  fast.
MATHEMATICS KBSR YEAR 4 Nor Salhana Binti Mohd. Arshad.
Digital to Analog (D/A) Converter Discussion D2.2.
Number Systems Discussion D4.1 Appendix C. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
The Lord of the Cache Project 3. Caches Three common cache designs: Direct-Mapped store in exactly one cache line Fully Associative store in any cache.
How caches take advantage of Temporal locality
Memory Hierarchies Exercises [ ] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with.
Introduction to Computer Engineering by Richard E. Haskell Number Systems Module M3.1 Sections
Caches The principle that states that if data is used, its neighbor will likely be used soon.
Digital to Analog (D/A) Converter Discussion D2.2.
Direct Map Cache Tracing Exercise. Exercise #1: Setup Information CS2100 Cache I 2 Memory 4GB Memory Address 310N-1N Block Number Offset 1 Block = 8 bytes.
CDA 3103 Computer Organization Review Instructor: Hao Zheng Dept. Comp. Sci & Eng. USF.
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
CSCE 212 Quiz 11 – 4/13/11 Given a direct-mapped cache with 8 one-word blocks and the following 32-bit memory address references: 1 2, ,
4/20/20051 Branch prediction Predict taken Predict not taken Taken Not taken.
COEN 180 Main Memory Cache Architectures. Basics Speed difference between cache and memory is small. Therefore:  Cache algorithms need to be implemented.
Caches – basic idea Small, fast memory Stores frequently-accessed blocks of memory. When it fills up, discard some blocks and replace them with others.
1 CMPE 421 Advanced Computer Architecture Caching with Associativity PART2.
Caches – basic idea Small, fast memory Stores frequently-accessed blocks of memory. When it fills up, discard some blocks and replace them with others.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
TDC 311 The Microarchitecture. Introduction As mentioned earlier in the class, one Java statement generates multiple machine code statements Then one.
Lecture Objectives: 1)Define set associative cache and fully associative cache. 2)Compare and contrast the performance of set associative caches, direct.
Ch. 12 Cache Direct Mapped Cache. Comp Sci mem hierarchy 2 Memory Hierarchy Registers: very few, very fast cache memory: small, fast main memory:
1 CMPE 421 Advanced Computer Architecture Accessing a Cache PART1.
Multiprocessor cache coherence. Caching: terms and definitions cache line, line size, cache size degree of associativity –direct-mapped, set and fully.
B. Ramamurthy.  12 stage pipeline  At peak speed, the processor can request both an instruction and a data word on every clock.  We cannot afford pipeline.
Lecture Objectives: 1)Explain the relationship between miss rate and block size in a cache. 2)Construct a flowchart explaining how a cache miss is handled.
AES Encryption FIPS 197, November 26, Bit Block Encryption Key Lengths 128, 192, 256 Number of Rounds Key Length Rounds Block.
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%
Systems I Cache Organization
Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques, performance and equations Basic multiplication.
Additional Slides By Professor Mary Jane Irwin Pennsylvania State University Group 1.
Cache Operation.
Recitation 6 – 3/11/01 Outline Cache Organization Replacement Policies MESI Protocol –Cache coherency for multiprocessor systems Anusha
Cache Organization 1 Computer Organization II © CS:APP & McQuain Cache Memory and Performance Many of the following slides are taken with.
CSE 351 Caches. Section Feedback Before we begin, we’d like to get some feedback about section If you could answer the following questions on the provided.
Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address Translation During Indexing of the Cache –Using.
Memory Hierarchy and Cache Design (3). Reducing Cache Miss Penalty 1. Giving priority to read misses over writes 2. Sub-block placement for reduced miss.
COSC2410: LAB 19 INTRODUCTION TO MEMORY/CACHE DIRECT MAPPING 1.
Binary Lesson 4a Hexadecimal and Binary Practice2.
Lecture 5 Cache Operation
CSCI206 - Computer Organization & Programming
Improving Memory Access The Cache and Virtual Memory
Address – 32 bits WRITE Write Cache Write Main Byte Offset Tag Index Valid Tag Data 16K entries 16.
Tutorial Nine Cache CompSci Semester One 2016.
CS2100 Computer Organization
Direct Cache Structure
Exercise 1: Binary number and hex number
Replacement Policy Replacement policy:
FLIPPED CLASSROOM ACTIVITY CONSTRUCTOR – USING EXISTING CONTENT
Consider a Direct Mapped Cache with 4 word blocks
Lecture: Large Caches, Virtual Memory
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
£"'>£"'>.I.I ' ·.· · ·..I.
Exploiting Memory Hierarchy Chapter 7
CSCI206 - Computer Organization & Programming
Module IV Memory Organization.
Set-Associative Cache
Interconnect with Cache Coherency Manager
Lecture 22: Cache Hierarchies, Memory
Direct Mapping.
Module IV Memory Organization.
Little Endian vs. Big Endian (Intel vs. Motorola)
CSCI 6307 Foundation of Systems – Exercise (3)
Cache Memory and Performance
Find the value of g. Find the value of h. 105° h g 75°
Advanced Encryption Standard (AES)
MIPS Assembly.
Presentation transcript:

Cache Memory Exercises

Questions I Given: –memory is little-endian and byte addressable; memory size; –number of cache blocks, size of cache block –An instruction lw $t0, x or lbu $t0, x; Determine –HIT or MISS? –What value is in $t0?; and –Show the cache after word is brought in if needed

Address (binary) Contents (Hex) aa bb cc dd ff ee a bc de f0 1a a 3a 4a 5a a 7a 8a 9a b 2b 3b 4b b2 b3 b4 b c1 c2 c3 c d1 d2 d3 d e1 e2 e3 e f1 f2 f3 f a1 a2 a3 a c 3c 4c 5c d 3d 4d 5d VTagdata(hex) a lbu $t0, x # x = Question 1: cache HIT or MISS? What is in $t0? Draw the cache after data is brought in Assume memory is little-endian and byte addressable; cache block = 1 word; Cache holds 4 blocks of data ( 4 words)

Address (binary ) Contents (Hex) aa bb cc dd ff ee a bc de f0 1a a 3a 4a 5a a 7a 8a 9a b 2b 3b 4b b2 b3 b4 b c1 c2 c3 c d1 d2 d3 d e1 e2 e3 e f1 f2 f3 f a1 a2 a3 a c 3c 4c 5c d 3d 4d 5d VTagdata(hex) Ffee lbu $t0, x # x = Question 2: cache HIT or MISS? What is in $t0? Draw the cache after data is brought in Assume memory is little-endian and byte addressable; cache block = 1 word; Cache holds 4 blocks of data ( 4 words)

Address (binary) Contents (Hex) aa bb cc dd ff ee a bc de f0 1a a 3a 4a 5a a 7a 8a 9a b 2b 3b 4b b2 b3 b4 b c1 c2 c3 c d1 d2 d3 d e1 e2 e3 e f1 f2 f3 f a1 a2 a3 a c 3c 4c 5c d 3d 4d 5d VTagdata(hex) lbu $t0, x # x = Question 3: cache HIT or MISS? What is in $t0? Draw the cache after data is brought in Assume memory is little-endian and byte addressable; cache block = 1 word; Cache holds 4 blocks of data ( 4 words)

Address (binary) Contents (Hex) ff ee a bc de f0 1a a 3a 4a 5a a 7a 8a 9a b 2b 3b 4b b2 b3 b4 b c1 c2 c3 c d1 d2 d3 d e1 e2 e3 e f1 f2 f3 f a1 a2 a3 a c 3c 4c 5c d 3d 4d 5d VTagdata(hex) lbu $t0, x # x = Question 4: cache HIT or MISS? What is in $t0? Draw the cache after data is brought in Assume memory is little-endian and byte addressable; cache block = 1 word; Cache holds 4 blocks of data ( 4 words)

Address (binary) Contents (Hex) aa bb cc dd ff ee a bc de f0 1a a 3a 4a 5a a 7a 8a 9a b 2b 3b 4b b2 b3 b4 b c1 c2 c3 c d1 d2 d3 d e1 e2 e3 e f1 f2 f3 f a1 a2 a3 a c 3c 4c 5c d 3d 4d 5d VTagdata(hex) lbu $t0, x # x = Question 5: cache HIT or MISS? What is in $t0? Draw the cache after data is brought in Assume memory is little-endian and byte addressable; cache block = 1 word; Cache holds 4 blocks of data ( 4 words)

Cache Question II-1 Suppose: 256 bytes of memory, cache holds 4 blocks, each block is 1 word. What is the cache size? Answer: aaaaaaaa  t t t t i i o o cache: valid tag data Cache size: (4+1+32)*4 bits

Cache Question II-2 Suppose: 256 bytes of memory, cache holds 8 blocks, each block is 1 word. What is the cache size? Answer: aaaaaaaa  t t t i i i o o cache: valid tag data Cache size: (3+1+32)*8 bits

Question II-3 What is the cache size (total number of bits) for a cache that holds 64KB of data (block == 1 word; 2**32 bytes of memory) Answer: 64KB == 16K words; –16K = (2**4) *(2**10) = 2**14 –So 14 bits are needed for the cache index Tag size = 32 – = 16 bits Cache size = (1 + ( ) + 32) * (2**14) = 784 K bits = 98 KB