• Post Reply Bookmark Topic Watch Topic
  • New Topic

methods help  RSS feed

 
johnathan smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am trying to write a program which manages a cache. 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 of the cache contents.

i have written a memory class with contains a 2d array and prints out random ints at each place in the array

i have also written a cache class which contains 4 arrays

i want to now is it possible to write it and miss rate methods in the cache class and print out the cache contents

any help would be greatly appreciated
thanks

the code for my classes is below:
memory class:


cache class
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not seeing the connection between your memory array and the Cache class. In my experience, caches have always had a key or a location plus a value. I'd expect to see something like

This feels like a Map with a few counters added. Does it seem to fit the problem somehow?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jonathan, that other thread I called a dup actually had some new information. Tell us what progress you've made lately. I hope it's been encouraging.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!