Cache Access Example (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024
  • Discusses how a set of addresses map to two different 2-way set-associative caches and determines the hit rates for each. This is a continuation of • Cache Access Example (... that discussed the same accesses in a direct mapped cache.
    NOTE: On the first access to 0x064 for the 2-way associative the LRU bit for Set 1 should be set to 1. This doesn't affect any of the rest of the explanation as the next access also sets the LRU to 1.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 67

  • @officialsterlingarcher
    @officialsterlingarcher 5 ปีที่แล้ว +71

    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 7 หลายเดือนก่อน

      @@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 ปีที่แล้ว +84

    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 4 ปีที่แล้ว

      i've got my final tomorrow lmao lets gooo

    • @DilpreetSingh-eh5kw
      @DilpreetSingh-eh5kw 4 ปีที่แล้ว

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

    • @chaewoonsong3525
      @chaewoonsong3525 4 ปีที่แล้ว +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! :)

  • @dipenbhuva2061
    @dipenbhuva2061 ปีที่แล้ว +5

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

  • @richardhall9815
    @richardhall9815 4 ปีที่แล้ว +21

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

  • @RyanTorrecampo
    @RyanTorrecampo 6 ปีที่แล้ว +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!

  • @shikharchaudhary6984
    @shikharchaudhary6984 4 ปีที่แล้ว +2

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

  • @lukebayliss147
    @lukebayliss147 6 ปีที่แล้ว +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.

  • @zakeria09
    @zakeria09 4 ปีที่แล้ว +3

    Final literally in 7 hours!! Thank you

  • @rihamaltawy8739
    @rihamaltawy8739 5 ปีที่แล้ว +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.

  • @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

  • @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.

  • @eddenfaun316
    @eddenfaun316 3 ปีที่แล้ว +1

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

  • @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?

  • @mich2k1
    @mich2k1 3 ปีที่แล้ว

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

  • @psyvatordarkpsy5284
    @psyvatordarkpsy5284 5 ปีที่แล้ว

    you saved my ass

  • @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.

  • @yehualawsimeneh7219
    @yehualawsimeneh7219 6 ปีที่แล้ว +2

    WOW WOW Nice vido

  • @Christian93G
    @Christian93G 3 ปีที่แล้ว

    the explanation is really really exhaustive and simple to undestand

  • @nickheiss2551
    @nickheiss2551 3 ปีที่แล้ว

    have finals tomorrow thank you!!

  • @netcat22
    @netcat22 3 ปีที่แล้ว

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

  • @trishapatel6311
    @trishapatel6311 ปีที่แล้ว

    ur a life saver

  • @galaxygio123
    @galaxygio123 3 ปีที่แล้ว

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

  • @aarontan5748
    @aarontan5748 ปีที่แล้ว

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

  • @saramillan4400
    @saramillan4400 3 ปีที่แล้ว

    Can you do a 4 way associative example?

  • @mahdimahdavi2527
    @mahdimahdavi2527 3 ปีที่แล้ว

    it's helpful
    thank you!

  • @jensenmiller6410
    @jensenmiller6410 4 ปีที่แล้ว

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

  • @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.

  • @jiaweisun9663
    @jiaweisun9663 3 ปีที่แล้ว

    You are an angel lol, saved my ass

  • @christiana1D
    @christiana1D 6 ปีที่แล้ว

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

  • @lilianboughannam7048
    @lilianboughannam7048 7 หลายเดือนก่อน

    why do we go with way 0 first?

    • @matthewwatkins88
      @matthewwatkins88  7 หลายเดือนก่อน

      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."

  • @ryanjackson0x
    @ryanjackson0x 4 ปีที่แล้ว

    Is there a transcript of the video?

  • @matthewwatkins88
    @matthewwatkins88  4 ปีที่แล้ว

    No, sorry.

  • @mehakwaseem1479
    @mehakwaseem1479 5 ปีที่แล้ว

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

  • @tek1234
    @tek1234 5 ปีที่แล้ว

    Cancer exam exercises

  • @kabirdevpaulbaghel833
    @kabirdevpaulbaghel833 3 ปีที่แล้ว

    u a real one

  • @manognajohn1508
    @manognajohn1508 6 ปีที่แล้ว

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

  • @user-yh9sz6eo9y
    @user-yh9sz6eo9y 6 ปีที่แล้ว

    Very well explained. Helped me a lot, ty

  • @Shietaehyung
    @Shietaehyung 3 ปีที่แล้ว

    great!!!!

  • @mrbfs07
    @mrbfs07 6 ปีที่แล้ว

    Thank you! Very good video

  • @selvalooks
    @selvalooks 5 ปีที่แล้ว

    another good one , thanks a lot!!

  • @l.o2845
    @l.o2845 3 ปีที่แล้ว

    great stuff 👌👌

  • @stideengarbanzo9862
    @stideengarbanzo9862 4 ปีที่แล้ว

    thank you so much

  • @jessebelleman8070
    @jessebelleman8070 4 ปีที่แล้ว

    Legend!

  • @muhammadatif25
    @muhammadatif25 6 ปีที่แล้ว

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

    • @scarybrowncub9102
      @scarybrowncub9102 5 ปีที่แล้ว +1

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

  • @roxerg
    @roxerg 5 ปีที่แล้ว

    this saved my life
    ty