Professional Documents
Culture Documents
Miss Rate Versus Block Size: 25% 1K 4K 16K 64K 256K
Miss Rate Versus Block Size: 25% 1K 4K 16K 64K 256K
25%
20% 1K
4K
15%
Miss
16K
Rate
10%
64K
5% 256K
0%
64
16
32
128
2
CS501
Advanced Computer
Architecture
Lecture 39
1000 CPU
µProc
60%/yr.
“Moore’s Law”
Performance
100 Processor-Memory
Performance Gap:
(grows 50% / year)
10
DRAM
DRAM
7%/yr.
1
1980
1981
1988
1996
1982
1983
1984
1985
1986
1987
1989
1990
1991
1992
1993
1994
1995
1997
1998
1999
2000
Year 4
Block Diagram of Cache
Cache
Control Logic
Determine
Fast
and Tag
Memory comparison RAM
unit
5
Int ALFA [100], SUM;
SUM = 0;
For ( i=1; i<=100; i++ )
{ SUM = SUM + ALFA[i]; }
6
Associative Cache
fig. 7.31(jordan)
Tag Valid Cache Main
memory bits memory memory
421 1 0 Cache block 0 MM block 0
? 0 1 ? MM block 1
119 1 2 Cache block 2 MM block 2
7
• Main memory address references
have two fields:
8
• 3-bit word field becomes a “cache
address”.
1
A rg u m e n t
r e g ist e r
M a tc h V a lid
b it b it
C a c h e b lo c k 0
2
?
M a tc h
C a c h e b lo c k 2
3
4
C a c h e b lo c k 2 5 5
64
O n e c a c h e lin e ,
8 b y te s
M a in m e m o ry a d d r e s s
Tag B y te 5
3
13 3 S e le c to r
6
To C PU
8 10
Direct-mapped cache
The main memory address is
partitioned into three fields:
• Word field
• Group field
• Tag field
11
Direct-mapped cache
• Cache address is composed of
two fields:
• Group field
• Word field
12
Figure: 7.34
(jordan)
13
Continued
15
Continued
16
Figure:7.33
(jordan)
17
Direct mapped cache
fig. 7.33 (Jordan)
Tag Valid Cache
memory bits memory Main memory block numbers Group #:
30 1 0 0 256 512 7680 7936 0
9 1 1 1 257 513 2305 7681 7937 1
1 1 2 2 258 514 7682 7938 2
19
Direct mapped cache
• Advantage:
simplicity
• Disadvantage:
only a single block from a given
group is present in cache at any time.
20
2-Way Set-Associative Cache
fig. 7.35(Jordan)
Tag Cache
memory memory Main memory block numbers Group #:
2 30 0 512 7680 0 256 512 7680 7936 0
2 9 1 513 2304 1 257 513 2304 7681 7937 1
1 2 258 2 258 514 7682 7938 2
22
Block Replacement
23
2-Way Set-Associative Cache
26
Continued