Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 3
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote