Results 1 to 11 of 11

Thread: Binary Cache

  1. #1
    Collider is offline Member
    Join Date
    Apr 2012
    Posts
    10
    Rep Power
    0

    Default Binary Cache

    Hey, I got this Coursework which I do not understand. I suppose to construct a program that manages cache that can store up to 256 Bytes. The cache should be organised as both Direct Mapped (assumes block size of 8 Bytes) and Fully associative. 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 do not expect you to do this for me but where do I start ? I am first year student at university and only have some basic knowledge of Java. How many classes am I going to need ? What methods in each class ? Am i going to have to use Array or arraylist ? What do they mean by Direct Mapped and Fully associative? Like I have no idea where to start could I please get some guidance on this ? Cheers

  2. #2
    jlczuk is offline Senior Member
    Join Date
    Apr 2012
    Location
    New York State of Confusion, USA
    Posts
    137
    Blog Entries
    1
    Rep Power
    0

    Default Re: Binary Cache

    Don't worry about how many classes and all that. What is ONE class you KNOW you need?

    While you think about that, you need to read up on how memory caches work. Regarding Direct Mapped and Fully Associative, these are not Java terms, they are terms applied to the behavior/characteristics of a memory cache. Start by understanding these two things with regard to your Cache.

    We can talk more once you've done these things.

  3. #3
    jlczuk is offline Senior Member
    Join Date
    Apr 2012
    Location
    New York State of Confusion, USA
    Posts
    137
    Blog Entries
    1
    Rep Power
    0

    Default Re: Binary Cache

    It's been a long time since I've had to deal with the details of memory caching, so I brushed up a little. Are you sure that your cache is supposed to be BOTH Direct Mapped AND Fully Associative? When you read up about these, you will understand why I ask this question.

  4. #4
    Collider is offline Member
    Join Date
    Apr 2012
    Posts
    10
    Rep Power
    0

    Default Re: Binary Cache

    Yes 100% sure that's what the PDF that we were given said. I will read up on it later on today got some other work atm. But thanks in advance

    This is what we were given:

    You are to construct a program that manages a cache that can store up to
    256 Bytes. The cache should be organised as both:
    Direct Mapped (assume block size of 8 Bytes), and
    Fully associative.
    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.
    Test data file is Test

  5. #5
    jlczuk is offline Senior Member
    Join Date
    Apr 2012
    Location
    New York State of Confusion, USA
    Posts
    137
    Blog Entries
    1
    Rep Power
    0

    Default Re: Binary Cache

    One cache can't be both fully associative and direct mapped, which makes me wonder if your Test input file will tell you which organization to use for that test. That would make more sense because it would allow you to see the miss rate differences between the two organizations. The two different organizations will behave very differently depending on the address reference patterns applied to the cache.

    Can you post what the assignment says the format of the Test data file is? Doe the program take some other input to specify which cache organization to use for a given Test file?

  6. #6
    Collider is offline Member
    Join Date
    Apr 2012
    Posts
    10
    Rep Power
    0

    Default Re: Binary Cache

    The format of the test file is just .txt and it has a LONG list of numbers in it.

    60
    65
    66
    73
    75
    79
    889
    894
    900
    910
    915
    919
    925
    935
    936
    475
    479
    480
    489
    495
    496
    500
    501
    513
    519
    521
    528
    530
    542
    550
    555
    559
    129
    155
    160
    169
    137
    909
    155
    925
    935
    936
    220
    225
    232
    236
    239
    240
    245
    248
    475
    475
    479
    480
    489
    495
    496
    500
    501
    513
    519
    377
    385
    396
    400
    411
    418
    420
    425
    521
    528
    530
    542
    550
    985
    986
    993
    999
    1007
    1008
    1010
    1015
    1020
    1022

  7. #7
    jlczuk is offline Senior Member
    Join Date
    Apr 2012
    Location
    New York State of Confusion, USA
    Posts
    137
    Blog Entries
    1
    Rep Power
    0

    Default Re: Binary Cache

    Thanks. I'm stumped then. Maybe someone else here knows how a memory cache can be both direct mapped and fully associative. Otherwise, I'd ask your professor about that.

    In the mean time, what is the one class you know you need? What data elements is it going to have to contain and what operations is it going to have to perform?

  8. #8
    Collider is offline Member
    Join Date
    Apr 2012
    Posts
    10
    Rep Power
    0

    Default Re: Binary Cache

    Okay got some update,I think we suppose to do it for both but not in one. May have two different classes one for directly mapped and one for fully associative.

  9. #9
    jlczuk is offline Senior Member
    Join Date
    Apr 2012
    Location
    New York State of Confusion, USA
    Posts
    137
    Blog Entries
    1
    Rep Power
    0

    Default Re: Binary Cache

    Quote Originally Posted by Collider View Post
    Okay got some update,I think we suppose to do it for both but not in one. May have two different classes one for directly mapped and one for fully associative.
    That makes MUCH more sense. Ok, back to my questions to help you get your head around the problem.

  10. #10
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Re: Binary Cache

    1. Read the notes given out in the lecture (the ones that have all the answers in them they are on blackboard)
    2. Read your notes you took in the lecture that detailed precisely how to do the coursework (that will tell you the method to use to store the cache as they told us several times in the lecture the best method...)
    3. Use two different classes, one for direct map, one for assosiative
    4. There is absolutely no additional advice available... except if we were to simply give you the required source code needed to solve the problem
    5. Turn up for the practicals... the advisors will help you if you are struggling... but just like anyone else(like us).. they shouldnt give you the answers... just help you to understand how to get the answers yourself
    6. ArrayStrings are very nice... maybe you should think about using those? ;)... dont use hash maps... its a silly and fiddly solution to a problem which at best... doesnt require that level of thinking... its only simulating a cache crudely.. nothing more!
    Last edited by cyber_pantalaimon; 05-02-2012 at 01:27 PM.

  11. #11
    Livi is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default Re: Binary Cache

    I just googled my uni coursework question and this came up! I have nooo idea how to do it either!!

Similar Threads

  1. Replies: 1
    Last Post: 11-01-2011, 05:35 PM
  2. JSP - using connection cache
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-30-2008, 09:54 AM
  3. BuffededImage cache
    By tim in forum New To Java
    Replies: 1
    Last Post: 01-24-2008, 12:00 AM
  4. cache problem in jsp
    By lpwing in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 01-15-2008, 07:43 AM
  5. Caché Monitor 0.35
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-10-2007, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •