Title: Memory Designs: Cache Example Minggu 10
1Memory Designs Cache Example (Minggu 10)
IKI 30210 Organisasi Sistim Komputer Fakultas
Ilmu KomputerUniversitas Indonesia
Johny Moningka (moningka_at_cs.ui.ac.id),
2Administra-trivia
- Tugas kelompok Survei Teknologi Memori.
- Topik
- konsep dasar jenis-jenis semikonduktor memori yg
penting, istilah dan leading technology. - Issue penting pilihan teknologi cost, kinerja,
aplikasi - Perkembangan teknologi memori (prediksi)
- Buat kelompok (max. 3 orang).
- Referensi
- Computer Org. , Harmacher 3th Edition
- Site internet tomshardware, pcguide, anandtech.
- Ralat batas akhir pengumpulan tugas 7 Des. 2004
(waktu kelas).
3Memory System
- Teknologi dan Sistem Memori
- Review teknologi memori
- Rancangan Memory Hierarchy
- Cache Memory
- Review Example Cache Operations
- Definition cache miss, hit, miss penalty
- Main Memory Virtual Memory
4Caching Terminology
- Saat prosesor mengakses memory maka terdapat 3
kemungkinan - cache hit blok cache valid dan sesuai dengan
alamat, word dapat dibaca dari cache - cache miss tidak ada blok dalam cache, jadi
mengambil (copy) blok dari memory ke cache - cache miss, block replacement blok pada cache
salah (address), ganti blok tersebut dengan
mengambil blok data dari memory
5Accessing data in a direct mapped cache
Memory
- Ex. 16KB of data, direct-mapped, 4 word blocks
(16 bytes per block) - Read 4 addresses
- 0x00000014
- 0x0000001C
- 0x00000034
- 0x00008014
- Memory values on right
- only cache/ memory level of hierarchy
Value of Word
Address (hex)
6Review Memorized this table yet?
- Blah blah Cache size 16KB blah blah 2? blocks
blah blah how many bits? - Answer! 2XY means
- X0 ? no suffix
- X1 ? kibi Kilo 103
- X2 ? mebi Mega 106
- X3 ? gibi Giga 109
- X4 ? tebi Tera 1012
- X5 ? pebi Peta 1015
- X6 ? exbi Exa 1018
- X7 ? zebi Zetta 1021
- X8 ? yobi Yotta 1024
Y0 ? 1 Y1 ? 2 Y2 ? 4 Y3 ? 8 Y4 ? 16 Y5 ?
32 Y6 ? 64 Y7 ? 128 Y8 ? 256 Y9 ? 512
WWW gt 170 Tb of information on its surface
Email gt 400 PB of new information/year
worldwide.(www.sims.berkeley.edu/research/project
s/how-much-info-2003/)
7Accessing data in a direct mapped cache
- Contoh mengakses 4 Alamat
- 0x00000014, 0x0000001C, 0x00000034, 0x00008014
- Contoh 4 alamat dibagi atas Tag, Index, Byte
Offset fields
000000000000000000 0000000001 0100 000000000000000
000 0000000001 1100 000000000000000000 0000000011
0100 000000000000000010 0000000001 0100 Tag
Index Offset
816 KB Direct Mapped Cache, 16B blocks
- Valid bit flag bit menentukan apakah isi blok
dari cache valid (when computer initially turned
on, all entries invalid)
Index
91. Read 0x00000014
- 000000000000000000 0000000001 0100
Tag field
Index field
Offset
Index
10So we read block 1 (0000000001)
- 000000000000000000 0000000001 0100
Tag field
Index field
Offset
Index
11No valid data
- 000000000000000000 0000000001 0100
Tag field
Index field
Offset
Index
12So load that data into cache, setting tag, valid
- 000000000000000000 0000000001 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
13Read from cache at offset, return word b
- 000000000000000000 0000000001 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
142. Read 0x0000001C 000 0..001 1100
- 000000000000000000 0000000001 1100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
15Index is Valid
- 000000000000000000 0000000001 1100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
16Index valid, Tag Matches
- 000000000000000000 0000000001 1100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
17Index Valid, Tag Matches, return d
- 000000000000000000 0000000001 1100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
183. Read 0x00000034 000 0..011 0100
- 000000000000000000 0000000011 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
19So read block 3
- 000000000000000000 0000000011 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
20No valid data
- 000000000000000000 0000000011 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
0
0
0
0
0
0
0
21Load that cache block, return word f
- 000000000000000000 0000000011 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
1
0
e
f
g
h
0
0
0
0
0
0
224. Read 0x00008014 010 0..001 0100
- 000000000000000010 0000000001 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
1
0
e
f
g
h
0
0
0
0
0
0
23So read Cache Block 1, Data is Valid
- 000000000000000010 0000000001 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
1
0
e
f
g
h
0
0
0
0
0
0
24Cache Block 1 Tag does not match (0 ! 2)
- 000000000000000010 0000000001 0100
Tag field
Index field
Offset
Index
0
1
0
a
b
c
d
0
1
0
e
f
g
h
0
0
0
0
0
0
25Miss, so replace block 1 with new data tag
- 000000000000000010 0000000001 0100
Tag field
Index field
Offset
Index
0
1
2
i
j
k
l
0
1
0
e
f
g
h
0
0
0
0
0
0
26And return word j
- 000000000000000010 0000000001 0100
Tag field
Index field
Offset
Index
0
1
2
i
j
k
l
0
1
0
e
f
g
h
0
0
0
0
0
0