Write a simple C program to simulate a two-way set associative cache. Assume the
ID: 3535261 • 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
ANSWER
THIS WILL HELP YOU
In case you have not previously compiled C programs on Linux, you will find the following commands helpful.
Or you can copy the files out of /usr/local/cs316/pa4:
cp -R /usr/local/cs316/pa4/ ~
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.