Skip to main content
add diagrams
Source Link
Dave Tweed
  • 178.3k
  • 17
  • 242
  • 418

It's six misses ifIf the block often words isn'tyou want to fetch happen to be aligned on cacheto the block boundaries. It's five, you'll only need to fetch 5 blocks, as shown here:

           ___
               Word 1000
           ___ Word 1001 ___
           1   Word 1002
           ___ Word 1003
           2   Word 1004
Cache      ___ Word 1005     The ten
Block      3   Word 1006     words you
Boundaries ___ Word 1007     want to
           4   Word 1008     fetch.
           ___ Word 1009
           5   Word 100A
           ___ Word 100B ___
               Word 100C
           ___ Word 100D
               Word 100E
           ___ Word 100F

However, if it is.the ten words start in the middle of a cache block, then they span a total of six blocks, as shown here:

           ___
               Word 1000
           ___ Word 1001
           1   Word 1002 ___
           ___ Word 1003
           2   Word 1004
Cache      ___ Word 1005     The ten
Block      3   Word 1006     words you
Boundaries ___ Word 1007     want to
           4   Word 1008     fetch.
           ___ Word 1009
           5   Word 100A
           ___ Word 100B
           6   Word 100C ___
           ___ Word 100D
               Word 100E
           ___ Word 100F

It's six misses if the block of words isn't aligned on cache block boundaries. It's five only if it is.

If the ten words you want to fetch happen to be aligned to the block boundaries, you'll only need to fetch 5 blocks, as shown here:

           ___
               Word 1000
           ___ Word 1001 ___
           1   Word 1002
           ___ Word 1003
           2   Word 1004
Cache      ___ Word 1005     The ten
Block      3   Word 1006     words you
Boundaries ___ Word 1007     want to
           4   Word 1008     fetch.
           ___ Word 1009
           5   Word 100A
           ___ Word 100B ___
               Word 100C
           ___ Word 100D
               Word 100E
           ___ Word 100F

However, if the ten words start in the middle of a cache block, then they span a total of six blocks, as shown here:

           ___
               Word 1000
           ___ Word 1001
           1   Word 1002 ___
           ___ Word 1003
           2   Word 1004
Cache      ___ Word 1005     The ten
Block      3   Word 1006     words you
Boundaries ___ Word 1007     want to
           4   Word 1008     fetch.
           ___ Word 1009
           5   Word 100A
           ___ Word 100B
           6   Word 100C ___
           ___ Word 100D
               Word 100E
           ___ Word 100F
added 5 characters in body
Source Link
Dave Tweed
  • 178.3k
  • 17
  • 242
  • 418

It's six misses if the block of words isn't aligned on cache block boundaries. It's five only if it is.

It's six misses if the block of words isn't aligned on cache block boundaries. It's five if it is.

It's six misses if the block of words isn't aligned on cache block boundaries. It's five only if it is.

Source Link
Dave Tweed
  • 178.3k
  • 17
  • 242
  • 418

It's six misses if the block of words isn't aligned on cache block boundaries. It's five if it is.