COA Lecture 16-Direct Mapped Cache PDF
COA Lecture 16-Direct Mapped Cache PDF
Block Length
( Words)
(a) Cache
Block
2
Word
Length
(b) Main memory
B L
First blocks of
cache memory
main memory
(equal to size of cache) = length of block in bits
= length of tag in bits
(a) Direct mapping
L0
one block of
main memory
L
cache memory
(b) Associative mapping
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39
1 3 (32)
Direct mapped cache
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
1 3 (32)
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
B B B B
VALID TAG 4 3 2 1
Data- 4 Bytes
For 64 KB, 64K/4B=16K blocks
214=16K Blocks
Problem 3
B B B B
VALID TAG 4 3 2 1
32 bit Address
32 1716 32 1
64K/4*4B = 4K=212
Byte offset, Block offset, 12 bits to select the
portion of the block, 16 bits TAG
Miss penalty
DRAM
Thank you for your listening