Note: For this homework assume the main memory has 16 addresses such that addres
ID: 3585381 • Letter: N
Question
Note: For this homework assume the main memory has 16 addresses such that address I has data Di, where 0 <= i <= 15.
Question 1. [20 points]
For a processor chip with a direct-mapped cache with 4 lines (or rows), show the mapping for the following address requests from the CPU and also indicate hit or miss for each. You must show the tag and index for each. Assume cold cache start and also assume addresses are real.
0, 4, 10, 0, 2, 3, 6, 7, 1, 15, 8, 14, 2, 3, 15
Explanation / Answer
Direct Mapped Cache(given):
Number of blocks/lines: 4 (given)
Size of each block=4 bytes(assume)
Memory address (given)=0,4,10,0,2,3,6,7,1,15,8,14,2,3,15
Memory block=Memory address/Size of each block=0,1,2,0,0,0,1,1,0,3,2,3,0,0,3
Cache block=Memory block%No of blocks in cache=0,1,2,0,0,0,1,1,0,3,2,3,0,0,3
Now, how the mapping is done:
0(hit)
Hit rate: 11/15=0.733
Miss rate: 4/15=0.266
Block no Cache block 0 0 1 1 2 2 3 3Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.