In this part of the assignment, you should implement a direct mapped cache as a Java class:
class DirectMappedCache
{
public DirectMappedCache(int totalSizeInKB, int bytesPerCacheLine)
{
1
// your implementation here
}
public bool ApplyAddress(int address)
{
// your implementation here
}
}
The ApplyAddress function should return true when a cache hit occurs, and false when a cache
miss occurs.
Using this class, write a program that reads a list of memory addresses (i.e., 32 bit integers) from
a _le, and prints out whether the addresses result in a cache hit or cache miss.
As part of your submission you should include a sample list of memory addresses, explaining
why your program reported a cache hit or miss in each case.
4 Part II: A Fully Associative Cache
In this part of the assignment you should implement a fully associative cache, that evicts cache
lines based on an LRU policy.
class FullyAssociativeCache
{
public FullyAssociativeCache(int totalSizeInKB, int bytesPerCacheLine)
{
// your implementation here
}
public bool ApplyAddress(int address)
{
// your implementation here
}
}
The ApplyAddress function should return true when a cache hit occurs, and false when a cache
miss occurs.
Using this class, write a program that reads a list of memory addresses (i.e., 32 bit integers) from
a _le, and prints out whether the addresses result in a cache hit or cache miss.
As part of your submission you should include a sample list of memory addresses, explaining
why your program reported a cache hit or miss in each case.
Hello,
my name is Fernando and i have more than 5 years of java programming experience. I can do your assigment very well structured and commented.
Thanks
$100 USD en 3 días
5,0 (14 comentarios)
4,3
4,3
2 freelancers están ofertando un promedio de $100 USD por este trabajo