Question: Question - 1 : a . For a Direct mapped cache, the cache has 4 blocks with each block containing 1 word. Fill out the

Question-1:
a. For a Direct mapped cache, the cache has 4 blocks with each block containing 1 word. Fill out the following table below to show the cache's state after the CPU accesses each of the following memory addresses in sequence: \(0,2,0,4,0\). As an example, the table is filled for the first address. Assume that the cache is empty at the beginning. Also, report the overall hit ratio.
[30 points]
Answer:
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline \multirow[t]{2}{*}{Memory Address} & \multirow[t]{2}{*}{Cache Index} & \multirow[t]{2}{*}{Hit or Miss} & \multicolumn{4}{|l|}{Cache content after Access}\\
\hline & & & Block 0 & Block 1 & Block 2 & Block 3\\
\hline 0 & 0 & Miss & Mem[0] & - & - & -\\
\hline 2 & 2 & Miss & Mem[0] & - & Mem[2] & -\\
\hline 0 & 0 & Hit & Mem[0] & - & Mem[2] & -\\
\hline 4 & 0 & Miss & Mem[4] & - & Mem[2] & -\\
\hline 0 & 0 & Miss & Mem[0] & - & Mem[2] & -\\
\hline
\end{tabular}
No of Hits =1
No of Misses \(=4\)
Total Accesses =5
Hit Ratio = No of Hits \(/\) Total Accesses =1/5
Miss Ratio = No of Misses \(/\) Total Accesses \(=4/5\)
Question - 1 : a . For a Direct mapped cache, the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!