1. Trang chủ
  2. » Giáo Dục - Đào Tạo

04 cache organization 18 24 tủ tài liệu bách khoa

13 55 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 13
Dung lượng 123,9 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The cache might get confused later!. And how do we solve that?... m-bit Address k bits m-k-n bits n-bit Block Offset Tag Index 4-bit Address?. bits?. bits ?-bits Block Offset block..

Trang 1

¢  

¢  

¢  

¢  

¢  

Trang 2

Where should we put data in the cache?

00

01

10

11

Index

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

Data

¢  How can we compute this mapping?

Trang 3

Where should we put data in the cache?

00

01

10

11

Index

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

Data

Hmm The cache might get confused later! Why? And how do we solve that?

Trang 4

01

10

11

Index

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

Tag Data

00

??

01

01

Trang 5

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Byte

Address

0

1

2

3

Index

0

1

2

3

4

5

6

7

Block (line) number

Trang 6

¢  

¢  

¢  

¢  

Trang 7

Problems with direct mapped caches?

program uses addresses

00

01

10

11 Index

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111 Memory Address

Trang 8

¢  

¢  

0

1

2

3

4

5

6

7

Set

0

1

2

3

Set

0

1

Set

1-way

8 sets,

1 block each

2-way

4 sets,

2 blocks each

4-way

2 sets,

4 blocks each

0

Set

8-way

1 set,

8 blocks

Trang 9

m-bit Address

k bits (m-k-n) bits

n-bit Block Offset Tag Index

4-bit Address

? bits

? bits

?-bits Block Offset

block Where would 13 (1101) be stored?

Trang 10

Example placement in set-associative caches

¢   0x1833in binary is 00 0110000 011 0011

0

1

2

3

4

5

6

7

Set

0

1

2

3

Set

0

1

Set

1-way associativity

8 sets, 1 block each 4 sets, 2 blocks each 2-way associativity 2 sets, 4 blocks each 4-way associativity

m-bit Address

k bits (m-k-n) bits

n-bit Block Offset Tag Index

Trang 11

Example placement in set-associative caches

¢   0x1833in binary is 00 0110000 011 0011

m-bit Address

k bits (m-k-4) bits

4-bit Block Offset Tag Index

0

1

2

3

4

5

6

7

Set

0

1

2

3

Set

0

1

Set 1-way associativity

8 sets, 1 block each 4 sets, 2 blocks each 2-way associativity 2 sets, 4 blocks each 4-way associativity

Trang 12

Block replacement

¢   Any empty block in the correct set may be used for storing data

¢   Replace something, of course, but what?

0

1

2

3

4

5

6

7

Set

0

1

2

3

Set

0

1

Set 1-way associativity

8 sets, 1 block each 4 sets, 2 blocks each 2-way associativity 2 sets, 4 blocks each 4-way associativity

Trang 13

¢  

¢  

¢  

¢  

Ngày đăng: 09/11/2019, 06:43

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm