Write a simple C program to simulate a two-way set associative cache. Assume the
ID: 3535236 • Letter: W
Question
Write a simple C program to simulate a two-way set associative cache.
Assume the following specifications:
Block size = 1 word (4 bytes)
Number of sets (height) = 4
Memory is 64 words
The program should read a series of memory addresses from an external file and display
whether a hit or miss occurred. At the termination, it should display the final contents of
the cache and give statistics on hits versus misses. To simplify parsing of the cache, you
can represent the tag and cache contents in separate array elements. The file called
addresses.txt will be placed on BlackBoard with the sequence of addresses (word level
as in class examples) to input to your program.
Explanation / Answer
Please rate with 5 stars :)
You will find the neccessary code and details here:
REFERENCE:
Cheers!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.