Docsity

Direct Mapping Address Structure, Slides of Computer Fundamentals

Toggle sidebar
bg1
Direct Mapping
Address Structure
Tag Line or Slot Word
ts w
•Cache line size determines how many bits in word field (ex: 32 bytes
=> w = 5)
•Number of lines in cache determines number of bits in slot field (ex:
4096 lines => s = 12)
•Address bits – (s+w) is tag size (ex: 32 bit addr – 17 bits => t = 15)
•So for memory address 4C0180F7:
4C0180F7 = 0100 1100 0000 0001 1000 0000 1111 0111
010011000000000 110000000111 10111
tag (15 bits) Slot(12 bits) word (5 bits)
•Each address maps to exactly ONE slot (determined by s field)
•To determine cache hit, compute slot number, check tag at that slot
against tag of memory address
pf3

Partial preview of the text

Download Direct Mapping Address Structure and more Slides Computer Fundamentals in PDF only on Docsity!

Direct Mapping

Address Structure

Tag Line or Slot Word

t

s w

  • Cache line size determines how many bits in word field (ex: 32 bytes => w = 5)
  • Number of lines in cache determines number of bits in slot field (ex: 4096 lines => s = 12)
  • Address bits – (s+w) is tag size (ex: 32 bit addr – 17 bits => t = 15)
  • So for memory address 4C0180F7: 4C0180F7 = 0100 1100 0000 0001 1000 0000 1111 0111 010011000000000 110000000111 10111 tag (15 bits) Slot(12 bits) word (5 bits)
  • Each address maps to exactly ONE slot (determined by s field)
  • To determine cache hit, compute slot number, check tag at that slot against tag of memory address

Tag t bits

Word w bits

Associative Mapping

Address Structure

  • Cache line size determines how many bits in word field (ex:

32 bytes => w = 5)

  • Remaining bits are the tag bits (ex. 32 bits => t=27)
  • Number of cache lines determines cache size, but nothing

else. ANY memory address can be in ANY cache line

  • So for memory address 4C0180F7: 4C0180F7 = 0100 1100 0000 0001 1000 0000 1111 0111 010011000000000110000000111 10111 tag (27 bits) word (5 bits)
  • To determine cache hit, examine tag field of ALL cache

lines simultaneously against tag field of memory address