Presentation is loading. Please wait.

Presentation is loading. Please wait.

Memory Hierarchies Exercises [7.1-7.3] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with.

Similar presentations


Presentation on theme: "Memory Hierarchies Exercises [7.1-7.3] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with."— Presentation transcript:

1 Memory Hierarchies Exercises [7.1-7.3] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with regards to data accesses very little spatial but very high temporal very high spatial but very little temporal

2 Memory Hierarchies Exercises [7.4-7.6] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with regards to instruction accesses very little spatial but very high temporal very high spatial but very little temporal

3 Memory Hierarchies Exercises [7.7] Here is a series of address references given as word addresses: 1, 4, 8, 5, 20, 17, 19, 56, 9, 11, 4, 43, 5, 6, 9, 17 assuming a direct-mapped cache of 16 one-word blocks that is initially empty, label each reference in the last as a hit or miss and show the cache’s final contents

4 Memory Hierarchies Exercises [7.7] SlotContents 0 11* 17 2 319 44* 20* 4 55 66 7 88* 56 99 10 1111* 43 12 13 14 15 Memory refCache hit/miss 1miss 4 8 5 20miss 17miss 19miss 56miss 9 11miss 4 43miss 5hit 6miss 9hit 17hit Asterisks (*) represent overwritten references

5 Memory Hierarchies Exercises [7.8] Here is a series of address references given as word addresses: 1, 4, 8, 5, 20, 17, 19, 56, 9, 11, 4, 43, 5, 6, 9, 17 assuming a direct-mapped cache of four- word blocks (16 words total) that is initially empty, label each reference in the last as a hit or miss and show the cache’s final contents

6 Memory Hierarchies Exercises [7.8] SlotContents Word in block 0123 016171819 14567 2891011 3 Memory refCache hit/miss 1miss 4 8 5hit 20miss 17miss 19miss 56miss 9 11hit 4miss 43miss 5hit 6 9 17hit

7 Memory Hierarchies Exercises [7.25] Can you make a fully associative cache containing exactly 3K words of data? How about a set-associative or a direct- mapped cache containing exactly 3K words of data?

8 Memory Hierarchies Exercises [7.25] Fully associative cache of 3K words? Yes. A fully associative cache has only one set, so no index is used to access the cache. Instead, we need to compare the tag with every cache location (3K of them). Set-associative cache of 3K words? Yes. Implement a three-way set-associative cache. This means that there will be 1024 sets, which require a 10-bit index field to access. Direct-mapped cache of 3K words? No. (Cannot be done efficiently.) To access a 3K word direct-mapped cache would require between 11 and 12 index bits. Using 11 bits will allow us to only access 2K of the cache, while using 12 bits will cause us to map some addresses to nonexistent cache locations.

9 Arithmetic Integer Representations [4.1-4.2] Convert these decimal values to Two’s Complement binary –0 –2 –512 –-1023

10 Arithmetic Integer Representations [4.1-4.2] Convert these decimal values to Two’s Complement binary –0 0000 0000 0000 0000 0000 0000 0000 0000 –2 0000 0000 0000 0000 0000 0000 0000 0010 –512 0000 0000 0000 0000 0000 0010 0000 0000 –-1023 1111 1111 1111 1111 1111 1100 0000 0001


Download ppt "Memory Hierarchies Exercises [7.1-7.3] Describe the general characteristics of a program that would exhibit very little spatial or temporal locality with."

Similar presentations


Ads by Google