Visit:: Join Telegram To Get Instant Updates: Contact: MAIL: Instagram: Instagram: Whatsapp Share
Visit:: Join Telegram To Get Instant Updates: Contact: MAIL: Instagram: Instagram: Whatsapp Share
io
INSTAGRAM: www.instagram.com/hemanthraj_hemu/
INSTAGRAM: www.instagram.com/futurevisionbie/
17CS72
MODULE-3
Syllabus:
MODULE Bus, Cache, and Shared Memory:
Shared Memory 1
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
6
https://hemanthrajhemu.github.io
7
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
• Clock cycle time determined by slowest device on bus (suitable for devices
with same speed)
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
• Arbitration competition and bus transactions take place concurrently on a parallel bus over
separate lines
https://hemanthrajhemu.github.io
• Signal line propagates bus-grant from first master to the last master
• One bus-request line from master activates bus-grant line which activates bus-busy line.
https://hemanthrajhemu.github.io
• Require a central arbiter, but can use a priority or fairness based policy
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
• Cache lookup occurs after address translation in TLB or MMU (no aliasing)
https://hemanthrajhemu.github.io
• Read:
• HIT if data is present in cache
• MISS if data is not in cache, load a block from main memory to cache
• Write:
• write-back (data written to main memory immediately) (needs more cycles)
• write-through policy (write to main memory is delayed until the cache block
is replaced)
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
• Aliasing Problem
• Different logically addressed data have the same index/tag in the cache
• Confusion if two or more processors access the same physical cache location
https://hemanthrajhemu.github.io
• Each block has b words b=2w, for cache total of m.b words,
main memory of n.b words
https://hemanthrajhemu.github.io
• Direct mapping of n/m memory blocks to one block frame in the cache
• Bj Bi if i=j mod m
https://hemanthrajhemu.github.io
• Higher speed
• Disadvantages
• Rigid mapping
• Poorer hit ratio
• Prohibits parallel virtual address translation
• Use largerhttps://hemanthrajhemu.github.io
cache size with more block frames to avoid contention
Department of Computer Science and Engg
31
Direct Mapping Cache
https://hemanthrajhemu.github.io
https://hemanthrajhemu.github.io
• Bj Bf Si if j(mod v) = i
https://hemanthrajhemu.github.io
• Use sector tags for search and block fields within sector to
find block
• The ith block in a sector placed into the ith block frame in a
destined sector frame
• Cycle count: # of m/c cycles needed for cache access, update, and
coherence
• Hit ratio: how effectively the cache can reduce the overall memory
access time
• Program trace driven simulation: present snapshots of program
behavior and cache responses
• Cycle Counts
• Cache speed affected by underlying static or dynamic RAM
technology, organization, and hit ratios
• Write-thru/write-back policies affect count
• Cache size, block size, set number, and associativity affect count
• Directly related to hit ratio
https://hemanthrajhemu.github.io
• Goal is to close the speed gap b/t CPU/cache and main memory
access
• Provides higher b/w for pipelined access of contiguous memory
locations
https://hemanthrajhemu.github.io