
Memory Hierarchy in Computer Architecture
Delve into the importance of cache memory in computer systems through a series of experiments evaluating memory access times under different scenarios like cache hits, misses, and random data accesses. Explore the impact of locality principle on justifying the use of cache memory and learn about cache organization designs like direct-mapped cache.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CSCE 513 Computer Architecture Lecture 6 Memory Hierarchy Topics Cache overview Readings: Appendix B September 20, 2017
B. 1 [10/ 10/ 10/ 15] < B. 1 > You are trying to appreciate how important the principle of locality is in justifying the use of a cache memory, so you experiment with a computer having an L1 data cache and a main memory (you exclusively focus on data accesses). The latencies (in CPU cycles) of the different kinds of accesses are as follows: cache hit, 1 cycle; cache miss, 105 cycles; main memory access with cache disabled, 100 cycles. a. [10] < B. 1 > When you run a program with an overall miss rate of 5%, what will the average memory access time (in CPU cycles) be? CSCE 513 Fall 2017 2
b. [10] < B. 1 > Next, you run a program specifically designed to produce completely random data addresses with no locality. Toward that end, you use an array of size 256 MB (all of it fits in the main memory). Accesses to random elements of this array are continuously made (using a uniform random number generator to generate the elements indices). If your data cache size is 64 KB, what will the average memory access time be? CSCE 513 Fall 2017 3
c. [10] < B. 1 > If you compare the result obtained in part (b) with the main memory access time when the cache is disabled, what can you conclude about the role of the principle of locality in justifying the use of cache memory? CSCE 513 Fall 2017 4
d. [15] < B. 1 > You observed that a cache hit produces a gain of 99 cycles (1 cycle vs. 100), but it produces a loss of 5 cycles in the case of a miss (105 cycles vs. 100). In the general case, we can express these two quantities as G (gain) and L (loss). Using these two quantities (G and L), identify the highest miss rate after which the cache use would be disadvantageous. CSCE 513 Fall 2017 5
B. 2 [15/ 15] < B. 1 > For the purpose of this exercise, we assume that we have 512-byte cache with 64-byte blocks. We will also assume that the main memory is 2 KB large. We can regard the memory as an array of 64- byte blocks: M0, M1, , M31. Figure B. 30 sketches the memory blocks that can reside in different cache blocks if the cache was fully associative. a. [15 ] < B. 1 > Show the contents of the table if cache is organized as a direct-mapped cache. CSCE 513 Fall 2017 6
b. [15] < B. 1 > Repeat part (a) with the cache organized as a four-way set associative cache. CSCE 513 Fall 2017 7
C. 6 [12/ 13/ 13/ 15/ 15] < C. 1, C. 2, C. 3 > We will now add support for register-memory ALU operations to the classic five-stage RISC pipeline. To offset this increase in complexity, all memory addressing will be restricted to register indirect (i.e., all addresses are simply a value held in a register; no offset or displacement may be added to the register value). For example, the register- memory instruction ADD R4, R5, (R1) means add the contents of register R5 to the contents of the memory location with address equal to the value in register R1 and put the sum in register R4. Register-register ALU operations are unchanged. The following items apply to the integer RISC pipeline: a. [12] < C. 1 > List a rearranged order of the five traditional stages of the RISC pipeline that will support register-memory operations implemented exclusively by register indirect CSCE 513 Fall 2017 8
b. [13] < C. 2, C. 3 > Describe what new forwarding paths are needed for the rearranged pipeline by stating the source, destination, and information transferred on each needed new path. CSCE 513 Fall 2017 9
c. [13] < C. 2, C. 3 > For the reordered stages of the RISC pipeline, what new data hazards are created by this addressing mode? Give an instruction sequence illustrating each new hazard. CSCE 513 Fall 2017 10
d. [15] < C. 3 > List all of the ways that the RISC pipeline with register-memory ALU operations can have a different instruction count for a given program than the original RISC pipeline. Give a pair of specific instruction sequences, one for the original pipeline and one for the rearranged pipeline, to illustrate each way. CSCE 513 Fall 2017 11
e. [15] < C. 3 > Assume that all instructions take 1 clock cycle per stage. List all of the ways that the register- memory RISC can have a different CPI for a given program as compared to the original RISC pipeline. CSCE 513 Fall 2017 12