Professional Documents
Culture Documents
Lab4
Lab4
Số phần tử trong 1 block = (size of block)/(size of phần tử truy xuất) = 256/1 = 2^8
Số block trong cache = (size of cache) / (size of block) = 1MB / 256B = 2^12 blocks.
• 4-Ways set associative: byte-offset 8 bits, index = 10 bits, tag = 32 - 8 - 10 = 14 bits ( do 4 block tạo
thành 1 set mà có 2^12 blocks nên có 2^10 sets )
Bài 2:
Số phần tử trong 1 block = (size of block)/(size of phần tử truy xuất) = 64words / 2 bytes = 2^7.
Số block trong cache = size of cache / size of block = 256KB / 64words = 256*1024/64*4 = 2^10 blocks.
Không gian địa chỉ là 256M, do đó ta dùng thanh ghi 28 bit tính theo byte-offset.
• 4 ways set associative: half-word offset 7 bits, index = 8 bits, tag = 28 – 7 - 8 = 13 bits. (do 4 block tạo
thành 1 set mà có 2^10 blocks nên có 2^8 sets )
Bài 3:
a. Directed map
c. Full associative.
Bài 4:
• L1 penalty = L2 AMAT.
Bài 5:
= Base CPI + tỉ lệ miss bộ nhớ lệnh * penalty bộ nhớ lệnh + tỉ lệ miss bộ nhớ dữ liệu * penalty bộ nhớ dữ
liệu