Targeted Course Learning Outcomes: CLO 2.1
Question 1: Using the “Direct Mapped Cache”, assume that
Index |
V |
Tag |
Data |
00 |
N |
||
01 |
N |
||
10 |
N |
||
11 |
N |
And the following addresses have been requested in the following sequences:
Request 1: Word Addresses 4, 5 and 7
Request 2: Word Addresses 0, 1 and 3
Request 3: Word Addresses 1, 2 and 3
Request 4: Word Addresses 3, 4 and 6
Hint: Follow the example in the next page and fill up all missing data accordingly and calculate the Hit and Miss ratios.
Request 1:
Word addr |
Binary addr |
Hit/miss |
Cache block |
4 |
100 |
Miss |
00 |
5 |
101 |
?? |
?? |
7 |
?? |
?? |
?? |
Before |
After |
||||||||||||||||||||||||||||||||||||||||
|
|
Request 2:
Word addr |
Binary addr |
Hit/miss |
Cache block |
0 |
?? |
?? |
?? |
1 |
?? |
?? |
?? |
3 |
?? |
?? |
?? |
Before |
After |
||||||||||||||||||||||||||||||||||||||||
|
|
Hit Ratio :
Miss Ratio :
Total # of block inside cache = 4. Therefore index offset =2 (Least Significant 2 bits since block offset is 0)
Tag (1 bit) |
Index Offset (2 bit) |
Word Offset (0 bits) |
Requesr 1:
Word Address | Binary Address | Hit/miss | Cache block |
4 | 100 | Miss | 00 |
5 | 101 | Miss | 01 |
7 | 111 | Miss | 11 |
After Index |
Valid | Tag | Data |
After Index |
Valid | Tag | Data | |
00 | N | 00 | V | 1 | 4 | |||
01 | N | 01 | V | 1 | 5 | |||
10 | N | 10 | N | |||||
11 | N | 11 | V | 1 | 7 |
Request 2:
Word Address | Binary Address | Hit/miss | Cache block |
0 | 000 | Miss | 00 |
1 | 001 | Miss | 01 |
3 | 011 | Miss | 11 |
After Index |
Valid | Tag | Data |
After Index |
Valid | Tag | Data | |
00 | V | 1 | 4 | 00 | V | 0 | 0 | |
01 | V | 1 | 5 | 01 | V | 0 | 1 | |
10 | N | 10 | N | |||||
11 | V | 1 | 7 | 11 | V | 0 | 3 |
Request 3:
Word Address | Binary Address | Hit/miss | Cache block |
1 | 001 | Hit | 00 |
2 | 010 | Miss | 10 |
3 | 011 | Hit | 11 |
After Index |
Valid | Tag | Data |
After Index |
Valid | Tag | Data | |
00 | V | 0 | 0 | 00 | V | 0 | 0 | |
01 | V | 0 | 1 | 01 | V | 0 | 1 | |
10 | N | 10 | V | 0 | 2 | |||
11 | V | 0 | 3 | 11 | V | 0 | 3 |
Request 4:
Word Address | Binary Address | Hit/miss | Cache block |
3 | 011 | Hit | 11 |
4 | 100 | Miss | 00 |
6 | 110 | Miss | 10 |
After Index |
Valid | Tag | Data |
After Index |
Valid | Tag | Data | |
00 | V | 0 | 0 | 00 | V | 1 | 4 | |
01 | V | 0 | 1 | 01 | V | 0 | 1 | |
10 | V | 0 | 2 | 10 | V | 1 | 6 | |
11 | V | 0 | 3 | 11 | V | 0 | 3 |
Total # of reference = 12
Total # of miss reference = 9
Total # of hit reference = 3
Therefore miss ratio= # of hit reference/ Total # of reference = 9/12=0.75
Hit ratio = # of hit reference/ Total # of reference = 3/12 =0.25
If you have any doubts, comment down. Also please upvote, thanks.
Targeted Course Learning Outcomes: CLO 2.1 Question 1: Using the “Direct Mapped Cache”, assume that 4-blocks,...
Question 33 10 pts For a direct mapped cache of 4 blocks with a cache block size of 1 byte, in which cache block will each memory location map to? The order of accesses if given by the operation number. Indicate if each access is a hit or a miss, and what the tag value is for each entry. Assume that the cache is initially empty, and the accesses are in order of appearance. REDRAW AND COMPLETE THE CACHE TABLE...
Assuming a direct-mapped cache with 4 four-word blocks that is initially empty, label each reference in the list as a hit or a miss and show the final contents of the cache. The following is a sequence of address references given as word addresses. 1, 5, 8, 4, 17, 19, 20, 6, 9, 8, 43, 5, 6, 21, 9, 17 Reference Hit or Miss Miss 17 19 20 43 Wordo Wordi Word2 Word 3 Block
We have a 4 KB direct-mapped data cache with 4-byte blocks. Consider this address trace: 0x48014554 0x48014548 0x48014754 0x48034760 0x48014554 0x48014560 0x48014760 0x48014554 For this cache, for each address in the above trace, show the tag, index and offset in binary (or hex). Indicate whether each reference is a hit or a miss. What is the miss rate?
6. (30) Consider a 64B direct-mapped cache with 16B blocks and 4 sets for an 8-bit architecture (i.e., 256 bytes of memory): a. (5) Write a C function unsigned char getTag(unsigned char address) that returns the cache tag for the specified address using bitwise operators: b. (5) Write a C function unsigned char getSet(unsigned char address) that returns the cache set for the specified address using bitwise operators: c. (10) Considering the following sequence of memory addresses, which addresses will...
Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of memory address references, given as word addresses (in decimal, the byte-offset bits have been excluded from addresses). 1, 4, 8, 5, 20, 17, 4, 56, 9, 10, 43, 5, 6, 9, 17 For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with two-word blocks (two words per block) and a total size of 8 blocks....
If I have a problem set like so: Below is a list of 64-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253 5.2.1 BLOCK SIZE: 1 word CACHE SIZE: 16 1-word blocks a) For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 16 one-word blocks. Also list if each reference is a hit or a miss, assuming 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...
Assume the following about a computer with a cache: .. The memory is byte addressable. • Memory accesses are to 1-byte words (not to 4-byte words). .. Addresses are 8 bits wide. .. The cache is 2-way associative cache (E=2), with a 2-byte block size (B=2) and 4 sets (5=4). • The cache contents are as shown below (V="Valid"): Set #Way #0 Way #1 V=1;Tag=0x12; Data = v=1;Tag=0x10; Data = Ox39 0x00 0x26 Ox63 V=1;Tag=0x09; Data = v=1;Tag=0x11; Data =...
if there is an empty box please put none. If the image is too small please open it in a new tab for an enlarged version. 4. (4pts) Assume that you have a direct-mapped cache with four-word blocks and a total size of 16 words that is initially empty, and that you will be given a series of word address references in the following order. Label each reference as a hit or a miss and show the content of the...
Please answer all parts correctly and show your work 3- for a direct mapped cache design with a 32 bit address, the following bits of address are used to access the cache Tag Index Offset 31-10 9-5 4-0 Starting from power on, the following byte addressed cache reference are recorded. Address 0 16 132 232 160 1024 30 140 3100180 2180 d. How many blocks are replaced e. What is the hit ratio f. List final state of the cache,...