




































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





































The Five Classic Components of a Computer
Today’s Topics:
The Big Picture: Where are We Now?
Control
Datapath
Memory
Processor Input
Output
μProc 60%/yr. (2X/1.5yr)
DRAM 9%/yr. (2X/10 yrs)
19801981198319841985198619871988198919901991199219931994199519961997199819992000
DRAM
CPU
1982
Processor-Memory Performance Gap: (grows 50% / year)
Time
“Moore’s Law”
Processor-DRAM Memory Gap (latency)
Who Cares About the Memory Hierarchy?
“Less’ Law?”
The Goal: Illusion of Large, Fast, Cheap Memory
Fact: Large memories are slow Fast memories are small
How do we create a memory that is large, cheap and fast (most of the time)?
Memory Hierarchy: Why Does it Work? Locality!
Temporal Locality (Locality in Time):
=> Keep most recently accessed data items closer to the processor
Spatial Locality (Locality in Space):
=> Move blocks consists of contiguous words to the upper levels
Lower Level Upper Level Memory Memory
To Processor
From Processor
Blk X Blk Y
(^0) Address Space 2^n - 1
Probability of reference
Two issues:
Our first example:
For each item of data at the lower level, there is exactly one location in the cache where it might be.
e.g., lots of items at the lower level share locations in the upper level
Cache
For MIPS:
What kind of locality are we taking advantage of?
Direct Mapped Cache Address (showing bit positions)
20 10
offsetByte
Index Valid Tag Data 0 1 2
1021 1022 1023
Tag Index
Hit Data
(^20 )
31 30 13 12 11 2 1 0
Taking advantage of spatial locality:
Direct Mapped Cache
Address (showing bit positions)
16 12 Byte offset
V Tag Data
Hit Data
(^16 )
4K entries
16 bits 128 bits
Mux
32 32 32
2
32
Index Block offset
Tag
31 16 15 4 3 2 1 0
Read hits
Read misses
Write hits:
Write misses:
Hits vs. Misses
Read:
Miss: send send full address to the main memory, when the memory returns with the data, we write it into the cache
Write:
Hits vs. Misses (Write through)
Memory Hierarchy: Terminology
Hit: data appears in some block in the upper level (example: Block X)
Miss: data needs to be retrieve from a block in the lower level (Block Y)
Hit Time << Miss Penalty Lower Level Upper Level Memory Memory
To Processor
From Processor
Blk X Blk Y
Recap: Cache Performance
CPU time = (CPU execution clock cycles + Memory stall clock cycles) x clock cycle time
Memory stall clock cycles = (Reads x Read miss rate x Read miss penalty + Writes x Write miss rate x Write miss penalty)
Memory stall clock cycles = Memory accesses x Miss rate x Miss penalty
Different measure: AMAT
Average Memory Access time (AMAT) = Hit Time + (Miss Rate x Miss Penalty)
Note: memory hit time is included in execution cycles.
How is the Hierarchy Managed?
Registers <-> Memory
cache <-> memory
memory <-> disks
Memory Hierarchy Technology
Random Access:
“Non-so-random” Access Technology:
Sequential Access Technology: access time linear in
location (e.g.,Tape)
Next two lectures will concentrate on random access
technology