Hello guys, im new in java and new in this forum.
I have this quite complicated, i think its complicated coursework that i have to finish in couple more days. Help pls.
You are to construct a program that manages a 0.25 KB cache.
(That is,data upto 256 Bytes can be stored in the cache.)
Cache is organised in:
Direct Mapped, and
The program takes address references in the range 0 .. 1023
and determines whether a given address reference is a hit or miss.
It also computes the Miss rate every time a miss is encountered
and at the end displays the overall Miss rate and the contents of the cache.
For displaying the cache contents, you may represent the memory
content at address A simply as M(A). You should assume that a cache block
holds 8 Bytes and, where necessary, employ the LRU scheme for block replacement.
I already have the scanner class that reads Text file with random elements.
all i need right know is to make direct mapped casche.
at the moment i have this
It's far from finish, please help. Im not quite good in cache at all.Code:
public class direct
final int n = 8;
final int m = 3;
final int i = 5;
private int hitCount;
public final synchronized void addElements(int m, int n)
If you want to check scanner class just write in this topic and i will post it.
How to make hit and miss count?
How to check it if its miss or hit?