Cache Access Example (Part 2)

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 67

  • @officialsterlingarcher
    @officialsterlingarcher 6 років тому +73

    Why is it you can explain what takes my teacher about two full weeks of lectures in just two videos under 30 minutes. Thank you so much you're a life saver.

    • @IStMl
      @IStMl 4 роки тому +5

      he spent 2 weeks on caches basics ??

    • @SmoothCode
      @SmoothCode 3 роки тому +1

      you mean shitty teachers?

    • @akaris.6184
      @akaris.6184 10 місяців тому

      @@IStMl depends on the syllabus. fully associative, set associative and direct mapped was like half of a topic for me, so it took 1.5-ish weeks

  • @lucazdelion
    @lucazdelion 7 років тому +85

    I have finals tomorrow, god bless you

    • @aotoki1154
      @aotoki1154 5 років тому

      What is the point of V beside the tag, when its value is 1 throughout the process?

    • @aotoki1154
      @aotoki1154 5 років тому

      And in this case is the value of offset considered? Seems like none of them was used.

    • @chaewoonsong3525
      @chaewoonsong3525 5 років тому

      i've got my final tomorrow lmao lets gooo

    • @DilpreetSingh-eh5kw
      @DilpreetSingh-eh5kw 5 років тому

      @@chaewoonsong3525 do you understand the use of LSU bit?

    • @chaewoonsong3525
      @chaewoonsong3525 5 років тому +2

      @@DilpreetSingh-eh5kw Yes, I can try to explain here - just had my final today lol.
      So the LRU stands for Least Recently Used which means we're adopting the eviction policy in which we kick out the address or data or tag or whatever you want to call it in the block that was literally the least recently used.
      So in this video, Matthew writes out the rows for our little 2 way set associative cache with 2 rows of cache blocks. We can see that up to 0x080, we store our tag in way 0 but when we have our first cache hit with 0x068, we are accessing the same index and thus we look at the first row of our cache. Our LRU bit is set to 1 before our hit because we have been storing our tag in Way 0 and that makes our Way 1 cache the "least recently used." (well we haven't even used it once here yet) so we indicate that by putting 1 there. But after our cache hit with 0x068, we cache our tag into Way 1 and that now makes Way 0 our least recently used, so we just indicate it by putting a 0 there.
      I think he put the LRU bit block to demonstrate how LRU works but in my exam we didn't have to indicate which block was LRU and stuff. Hope this helps and let me know if you have further questions! :)

  • @RyanTorrecampo
    @RyanTorrecampo 7 років тому +18

    Watching both of your videos made everything I know about cache click. Great examples. My final is tomorrow and now I feel that I understand everything about cache which is a quarter of the final. Thank you!

  • @lukebayliss147
    @lukebayliss147 7 років тому +3

    Exam in 2 days and just found this, I don't think I've ever loved someone over the internet as much as I do right now.

  • @eddenfaun316
    @eddenfaun316 3 роки тому +1

    you're saving our lives , we're taking an exam an hour from now and it's all clear . Thanks

  • @Christian93G
    @Christian93G 3 роки тому

    the explanation is really really exhaustive and simple to undestand

  • @dipenbhuva2061
    @dipenbhuva2061 2 роки тому +5

    5:18 Doesnt the LRU change to 1 because of Hit for last address ??

  • @richardhall9815
    @richardhall9815 5 років тому +21

    I didn't know Tom Hanks made videos about instruction pipelining in his free time!

  • @pilotandy_com
    @pilotandy_com 6 років тому

    Wow! Thank you for explaining this so well. I'm a hobbyist, so I don't have the benefit of textbooks and courses to work through. Now that I understand the workflows, the next step is describing it in hardware.

  • @aarontan5748
    @aarontan5748 Рік тому

    Thank you for both videos. Better than what I got at the university.

  • @zakeria09
    @zakeria09 4 роки тому +3

    Final literally in 7 hours!! Thank you

  • @galaxygio123
    @galaxygio123 3 роки тому

    I will have exam question very similar to this and you just saved my life! thanks a lot

  • @wickedsnuk3812
    @wickedsnuk3812 6 років тому +9

    after the last hit in the 1st time through, why we didnt update the lru as 1 ?

    • @aotoki1154
      @aotoki1154 5 років тому +1

      What is the point of V beside the tag, when its value is 1 throughout the process?

    • @aotoki1154
      @aotoki1154 5 років тому +1

      And in this case is the value of offset considered? Seems like none of them was used.

  • @deeparshankhadka7596
    @deeparshankhadka7596 4 роки тому +1

    What is the size of the cache in the given example? Is it a cache of size 2, or will it be considered a 4 sized cache?

    • @marksladen2901
      @marksladen2901 4 роки тому +1

      Right at the beginning of the video, it says 128 B cache. He probably emphasized more in the first video that it was 128 bytes.
      Matthew Watkins uses the term "ways." I have a textbook which uses the term "lines" and gives "lines" the letter "E" in the equation C = B × E × S
      Cache_size = Block_size × #_of_lines(or 'ways') × #_of_sets
      #_of_sets = Cache_size ÷ (Block_size × #_of_lines(or 'ways'))
      #_of sets = 128 ÷ (32 × 2)
      #_of sets = 2

  • @rihamaltawy8739
    @rihamaltawy8739 6 років тому +1

    Hi, although a fully associative cache has the best hit rate, for that particular example, it is worse than 2-way set associative, can you comment on that? Thank you for the nice video.

  • @shikharchaudhary6984
    @shikharchaudhary6984 5 років тому +2

    You did not update LRU from 0 to 1 for the last address of first stage.

  • @ggme7857
    @ggme7857 7 років тому +2

    On the first time at 0x064 shouldn't you change the LRU to 1?. It doesn't change anything i am just asking to see if i got it right

    • @matthewwatkins88
      @matthewwatkins88  7 років тому +1

      You're correct, it should be updated at the first access to 0x064. (Luckily the next access is to the same set and it is updated then, so the end result is not affected.)

    • @aotoki1154
      @aotoki1154 5 років тому

      What is the point of V beside the tag, when its value is 1 throughout the process?

    • @aotoki1154
      @aotoki1154 5 років тому

      And in this case is the value of offset considered? Seems like none of them was used.

  • @saramillan4400
    @saramillan4400 4 роки тому

    Can you do a 4 way associative example?

  • @ryanjackson0x
    @ryanjackson0x 5 років тому

    Is there a transcript of the video?

  • @sarahkuhn1076
    @sarahkuhn1076 Рік тому

    i don't understand how I get from 0x070 to the tag of 0000001 and set 1 offset 100000 etc. i.ex.i don't get the translation from the cache access address to the cache address

    • @matthewwatkins88
      @matthewwatkins88  Рік тому

      My first thought is that you are dealing with two different "nomenuclatures", one being hexadecimal and the other being binary. Have you been keeping that it mind?

  • @netcat22
    @netcat22 4 роки тому

    Thank you very much! This helped a lot with my university assignment.

  • @christiana1D
    @christiana1D 6 років тому

    thank you so much!! this one helped me and i have exam in few hours!!

  • @nickheiss2551
    @nickheiss2551 3 роки тому

    have finals tomorrow thank you!!

  • @jensenmiller6410
    @jensenmiller6410 4 роки тому

    Thank you, part 1 and 2 have pulled my ass out of the fire.

  • @lilianboughannam7048
    @lilianboughannam7048 10 місяців тому

    why do we go with way 0 first?

    • @matthewwatkins88
      @matthewwatkins88  10 місяців тому

      Assuming your question is "why do we start with way 0 (and not 1)" the answer is pretty simple, there is no reason why we couldn't have start with way 1 and then went with way 0. I would say though that we went with what is generally consider "conventnion."

  • @muhammadatif25
    @muhammadatif25 6 років тому

    if tag has matched but valid bit is 0, then will it be a hit or miss?

    • @scarybrowncub9102
      @scarybrowncub9102 6 років тому +1

      It is impossible? When valid bit is 0, the cache line is not filled with anything.

  • @user-yh9sz6eo9y
    @user-yh9sz6eo9y 6 років тому

    Very well explained. Helped me a lot, ty

  • @mehakwaseem1479
    @mehakwaseem1479 5 років тому

    Thank youu, you're a life savior. :)

  • @roxerg
    @roxerg 6 років тому

    this saved my life
    ty

  • @manognajohn1508
    @manognajohn1508 6 років тому

    god bless you , this one helped me a lot !!!

  • @trishapatel6311
    @trishapatel6311 Рік тому

    ur a life saver

  • @selvalooks
    @selvalooks 5 років тому

    another good one , thanks a lot!!

  • @mrbfs07
    @mrbfs07 6 років тому

    Thank you! Very good video

  • @l.o2845
    @l.o2845 4 роки тому

    great stuff 👌👌

  • @mich2k1
    @mich2k1 4 роки тому

    unluckyly you dont say if is compulsory, conflict or capacity, too much easy in this way

  • @kabirdevpaulbaghel833
    @kabirdevpaulbaghel833 3 роки тому

    u a real one

  • @mahdimahdavi2527
    @mahdimahdavi2527 3 роки тому

    it's helpful
    thank you!

  • @jessebelleman8070
    @jessebelleman8070 4 роки тому

    Legend!

  • @stideengarbanzo9862
    @stideengarbanzo9862 5 років тому

    thank you so much

  • @jiaweisun9663
    @jiaweisun9663 4 роки тому

    You are an angel lol, saved my ass

  • @Shietaehyung
    @Shietaehyung 3 роки тому

    great!!!!

  • @psyvatordarkpsy5284
    @psyvatordarkpsy5284 6 років тому

    you saved my ass

  • @yehualawsimeneh7219
    @yehualawsimeneh7219 7 років тому +2

    WOW WOW Nice vido

  • @matthewwatkins88
    @matthewwatkins88  5 років тому

    No, sorry.

  • @tek1234
    @tek1234 5 років тому

    Cancer exam exercises