Contoh Soal Direct Mapping pada Cache Memory
Diketahui:
- Main Memory 16 MB
- Cache 64 kB
- 1 byte = 1 alamat
- 1x transfer data = 1 blok memori = 1 line cache = 4 byte = 4 alamat
Pertanyaan:
Sebutkan jumlah bit untuk tag (s-r), line (r), dan word (w)!
Penyelesaian:
- Jumlah alamat total = 16 MB/8 byte = 16 M alamat
- Memory 16 M alamat = 2^4.2^20 = 2^24 maka jumlah bit alamat yang diperlukan (lebar alamat) = 24 bit
- Jumlah bit identitas word (w) = 2 bit (1 blok = 4 byte = 2^2)
- Jumlah line cache = 64 kB/4 byte = 16 k line
- 16 k = 2^4.2^10 = 2^14 maka jumlah bit line = 14 bit
- Jumlah bit tag (s-r) = 24-14-2 = 8 bit (lebar alamat-bit line cache-bit word)
Filed by moroncoder at June 11th, 2007 under Uncategorized