




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this lecture are: Memory Hierarchy, Locality, Cache Design, Virtual Address Spaces, Page Table Layout, Design Options, Levels of Memory Hierarchy, Programs Address, Principle of Locality, Block Placement, Direct Mapped
Typology: Slides
1 / 36
This page cannot be seen from the preview
Don't miss anything!





























Docsity.com
Docsity.com
Apple ][ (1977)
Steve Wozniak^ Steve Jobs
CPU: 1000 ns DRAM: 400 ns
Docsity.com
CPU Registers 100s Bytes <10s ns Cache K Bytes 10-100 ns 1-0.1 cents/bit
Main Memory M Bytes 200ns- 500ns$.0001-.00001 cents /bit Disk G Bytes, 10 ms (10,000,000 ns) 10 -5 - 10-6 cents/bit
Capacity Access Time Cost
Tape infinite sec-min 10 -
Registers
Cache
Memory
Disk
Tape
Instr. Operands
Blocks
Pages
Files
StagingXfer Unit
prog./compiler 1-8 bytes
cache cntl 8-128 bytes
OS512-4K bytes
user/operator Mbytes
Upper Level
Lower Level
faster
Larger
Docsity.com
(1K)
R eg ist er s 512KL
L1 (64K Instruction)
L1 (32K Data) Docsity.com
It is a property of programs which is exploited in machine design.
Docsity.com
Lower Level To Processor Upper Level Memory^ Memory
From Processor^ Blk X Blk Y Docsity.com
01234567 01234567 01234567
Memory
012345678901234567890123456789011111111111222222222233
Full Mapped Direct Mapped(12 mod 8) = 4 (12 mod 4) = 0^ 2-Way Assoc
Docsity.com
Block Offset
Block Address Tag Index
Docsity.com
Q3: After a cache read miss, if there are no empty cache blocks, which block should be removed from the cache?
A randomly chosen block? Easy to implement, how well does it work?
The Least Recently Used (LRU) block? Appealing, but hard to implement for high associativity
Miss Rate for 2-way Set Associative Cache Also, try other LRU approx.
Size Random LRU 16 KB (^) 5.7% 5.2% 64 KB 2.0% 1.9% 256 KB (^) 1.17% 1.15%
Docsity.com
Write-Through Write-Back
Policy
Data written to cache block also written to lower- level memory
Write data only to the cache Update lower level when a block falls out of the cache Debug Easy Hard Do read misses produce writes? No^ Yes Do repeated writes make it to lower level?
Yes No
Additional option -- let writes to an un-cached address allocate a new cache line (“write-allocate”). Docsity.com
CPU (^) Memory
A0-A31 A0-A
D0-D31 D0-D
“Physical addresses” of memory locations
Data All programs share one address space: The physical address space
No way to prevent a program from accessing any machine resource
Machine language programs must be aware of the machine organization
Docsity.com