Question

Let’s say that we have a 4-way set associative cache. The cache has 16 sets in total. Main memory consists of 16K blocks of 16 words each, and word addressing is used. a. Show the address format that is used to map main memory address to the cache. Include the appropriate fields and their sizes. For the remaining questions, assume that we have the following situation: We have a program that loops 6 times from location 1209810 in memory to location 1238610. In other words, think of this as an assembly language program that runs from the opcode at location 12098 to the opcode at location 12386, then loops back to location 12098. It does 6 such iterations in total (the original pass, plus 5 more loops). You can assume that the cache is initially empty.

At the end of the first iteration, how many blocks of memory are stored in the cache?

c. At the end of the first iteration, how many of these blocks are stored in (i) Set 2 (ii) Set 5

d. At the end of the first iteration, what is the hit ratio for the cache? The hit ratio should be expressed as a percentage (e.g., 85.67% or 96.35%)

e. At the end of all 6 iterations, what is the hit ratio for the cache?

#### Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
• ### 2. (15 points total, 3 pts each) Let’s say that we have a 4-way set associative...

2. (15 points total, 3 pts each) Let’s say that we have a 4-way set associative cache. The cache has 16 sets in total. Main memory consists of 16K blocks of 16 words each, and word addressing is used. a. Show the address format that is used to map main memory address to the cache. Include the appropriate fields and their sizes. For the remaining questions, assume that we have the following situation: We have a program that loops 6...

• ### 6. A 2-way set associative cache consists of four sets. Main memory contains 2K blocks of...

6. A 2-way set associative cache consists of four sets. Main memory contains 2K blocks of eight words each. a. Show the main memory address format that allows us to map addresses from main memory to cache. Be sure to include the fields as well as their sizes. b. Compute the hit ratio for a program that loops 5 times from locations 8 to 51 in main memory. You may leave the hit ratio in terms of a fraction.

• ### A 2-way set associative cache consists of four sets 0, 1, 2, 3. The main memory...

A 2-way set associative cache consists of four sets 0, 1, 2, 3. The main memory is word addressable (i.e. treat the memory as an array of words indexed by the address). It contains 2048 blocks 0 through 2047, and each block has eight words. (a) How many bits are needed to address the main memory? (b) Show how a main memory address will be translated into a tag, a set number, and an offset within a block. Illustrate this...

• ### Suppose a computer using set associative cache has 216 words of main memory and a cache...

Suppose a computer using set associative cache has 216 words of main memory and a cache of 32 blocks, and each cache block contains 8 words. 3. If this cache is 2-way set associative, what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, set, and word fields? If this cache is 4-way set associative, what is the format of a memory address as seen by the cache?...

• ### 1. 2-way Set Associative Cache Memory Consider a hypothetical machine with 1K words of cache memo...

1. 2-way Set Associative Cache Memory Consider a hypothetical machine with 1K words of cache memory. They are in two-way set associative organization, with cache block size of 128 words, using LRU replacement algorithm. Suppose the cache hit time is 9ns, the time to transfer the first word from main memory to cache is 50ns, while subsequent words require 10ns/word. Consider the following read pattern (in blocks of 128 words, and block id starts from 0): 1 2 3 5...

• ### Assume the cache can hold 64 kB. Data are transferred between main memory and the cache...

Assume the cache can hold 64 kB. Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K=2^14 lines of 4 bytes each. The main memory consists of 16 MB, with each byte directly addressable by a 24-bit address (2^24 =16M). Thus, for mapping purposes, we can consider main memory to consist of 4M blocks of 4 bytes each. Please show illustrations too for all work. Part...

• ### You have a 2-way set associative L1 cache that is 8KB, with 4-word cache lines. You get the follo...

You have a 2-way set associative L1 cache that is 8KB, with 4-word cache lines. You get the following sequence of writes to the cache --each is a 32-bit address in hexadecimal 0x32E4 0x8000 0x1F50 0x8004 0x72EC OxDOOC 0x800C 0x72E8 0x4008 OxD000 0x82E0 a) [7 Pts] How many cache misses occur with an LFU (Least Frequently Used) policy? Give a detailed answer and fill in the table below for each address reference Set Index (in hex) Memory address(in hex) 0x32E4...

• ### 6. What is the difference between a Direct map cache and Set associative cache. If we...

6. What is the difference between a Direct map cache and Set associative cache. If we are looking for block #26, block 32 and block #10 in an 8 way set associative and 4 block direct mapped cache. Where can we find these blocks. (Show your work) 7. What are the differences between SRAM, DRAM, SDRAM, who implements SRAM and SDRAM 8. What is a DIMM, So-Dimm and DDR, list different versions of DDR, what are the differences between those...

• ### Example 4.2 For all three cases, the example includes the following elements: The cache can hold...

Example 4.2 For all three cases, the example includes the following elements: The cache can hold 64 Kbytes. Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K = 214 lines of 4 bytes each. The main memory consists of 16 Mbytes, with each byte directly addressable by a 24-bit address (24 = 16M). Thus, for mapping purposes, we can consider main memory to consist of...

• ### Consider a 32-bit microprocessor that has on-chip 16Kbyte four-way set associative cache. Assume that cache has...

Consider a 32-bit microprocessor that has on-chip 16Kbyte four-way set associative cache. Assume that cache has a line size of four 32-bit words. How many number of set are there? Sketch block diagram of this cache showing its organization. Where in the cache is the word from memory location ABCDE7F4.