Because there are fewer cache lines than main memory blocks, an algori dịch - Because there are fewer cache lines than main memory blocks, an algori Việt làm thế nào để nói

Because there are fewer cache lines

Because there are fewer cache lines than main memory blocks, an algorithm is needed for mapping main memory blocks into cache lines. Further, a means is needed for determining which main memory block currently occupies a cache line. The choice of the mapping function dictates how the cache is organized.Three tech- niques can be used:direct,associative,and set associative.We examine each of these in turn. In each case, we look at the general structure and then a specific example.
Example 4.2 For all three cases, the example includes the following elements:
• The cache can hold 64 KBytes. • Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K 214 lines of 4 bytes each. • The main memory consists of 16 Mbytes, with each byte directly addressable by a 24-bit address (224 16M).Thus, for mapping purposes, we can consider main mem- ory to consist of 4M blocks of 4 bytes each.
DIRECT MAPPING The simplest technique, known as direct mapping, maps each block of main memory into only one possible cache line. The mapping is ex- pressed as
where
i cache line number j main memory block number m number of lines in the cache
Figure 4.8a shows the mapping for the first blocks of main memory. Each block of main memory maps into one unique line of the cache.The next blocks of main memory map into the cache in the same fashion; that is, block Bm of main memory maps into line L0 of cache, block Bm1 maps into line L1, and so on. The mapping function is easily implemented using the main memory address. Figure 4.9 illustrates the general mechanism. For purposes of cache access, each main memory address can be viewed as consisting of three fields. The least signifi- cant w bits identify a unique word or byte within a block of main memory; in most contemporary machines,the address is at the byte level.The remaining s bits specify one of the 2s blocks of main memory.The cache logic interprets these s bits as a tag of srbits (most significant portion) and a line field of r bits.This latter field iden- tifies one of the m 2r lines of the cache.To summarize,
• Address length (sw ) bits • Number of addressable units  2sw words or bytes • Block size line size 2w words or bytes
• Number of blocks in main memory
• Number of lines in cache m 2r • Size of cache 2rw words or bytes • Size of tag (sr ) bits
The effect of this mapping is that blocks of main memory are assigned to lines of the cache as follows:
Thus, the use of a portion of the address as a line number provides a unique mapping of each block of main memory into the cache. When a block is actually read into its assigned line, it is necessary to tag the data to distinguish it from other blocks that can fit into that line. The most significant srbits serve this purpose.

Example 4.2a Figure 4.10 shows our example system using direct mapping.5 In the ex- ample, m 16K 214 and ijmodulo 214. The mapping becomes == =
4.3 / ELEMENTS OF CACHE DESIGN 127
WordL ineTag
WO W1 W2 W3
Compare
1 if match 0 if no match
0 if match 1 if no match
W4j W(4j+1) W(4j+2) W(4j+3)
Tag Data Cache
L0
Li
Memory address
(Miss in cache)
(Hit in cache)
w
s – r
wr
s + w
Main memory
Bj
B0
s
w
Lm–1
s – r
Figure 4.9 Direct-Mapping Cache Organization
Note that no two blocks that map into the same line number have the same tag num- ber.Thus,blocks with starting addresses 000000,010000, FF0000 have tag numbers 00, 01, FF, respectively. Referring back to Figure 4.5, a read operation works as follows.The cache system is presented with a 24-bit address.The 14-bit line number is used as an index into the cache to access a particular line.If the 8-bit tag number matches the tag number currently stored in that line,then the 2-bit word number is used to select one of the 4 bytes in that line.Oth- erwise, the 22-bit tag-plus-line field is used to fetch a block from main memory.The actual address that is used for the fetch is the 22-bit tag-plus-line concatenated with two 0 bits,so that 4 bytes are fetched starting on a block boundary. Á , Á ,
Cache Line Starting Memory Address of Block 0 000000, 010000, FF0000 1 000004, 010004, FF0004
214 1 00FFFC, 01FFFC, FFFFFC Á ,- oo Á , Á ,
5In this and subsequent figures, memory values are represented in hexadecimal notation. See Chapter 19 for a basic refresher on number systems (decimal, binary, hexadecimal).
Note: Memory address values are in binary representation; other values are in hexadecimal
The direct mapping technique is simple and inexpensive to implement. Its main disadvantage is that there is a fixed cache location for any given block.Thus,if a program happens to reference words repeatedly from two different blocks that map into the same line,then the blocks will be continually swapped in the cache,and the hit ratio will be low (a phenomenon known as thrashing).

0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Because there are fewer cache lines than main memory blocks, an algorithm is needed for mapping main memory blocks into cache lines. Further, a means is needed for determining which main memory block currently occupies a cache line. The choice of the mapping function dictates how the cache is organized.Three tech- niques can be used:direct,associative,and set associative.We examine each of these in turn. In each case, we look at the general structure and then a specific example.
Example 4.2 For all three cases, the example includes the following elements:
• The cache can hold 64 KBytes. • Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K 214 lines of 4 bytes each. • The main memory consists of 16 Mbytes, with each byte directly addressable by a 24-bit address (224 16M).Thus, for mapping purposes, we can consider main mem- ory to consist of 4M blocks of 4 bytes each.
DIRECT MAPPING The simplest technique, known as direct mapping, maps each block of main memory into only one possible cache line. The mapping is ex- pressed as
where
i cache line number j main memory block number m number of lines in the cache
Figure 4.8a shows the mapping for the first blocks of main memory. Each block of main memory maps into one unique line of the cache.The next blocks of main memory map into the cache in the same fashion; that is, block Bm of main memory maps into line L0 of cache, block Bm1 maps into line L1, and so on. The mapping function is easily implemented using the main memory address. Figure 4.9 illustrates the general mechanism. For purposes of cache access, each main memory address can be viewed as consisting of three fields. The least signifi- cant w bits identify a unique word or byte within a block of main memory; in most contemporary machines,the address is at the byte level.The remaining s bits specify one of the 2s blocks of main memory.The cache logic interprets these s bits as a tag of srbits (most significant portion) and a line field of r bits.This latter field iden- tifies one of the m 2r lines of the cache.To summarize,
• Address length (sw ) bits • Number of addressable units  2sw words or bytes • Block size line size 2w words or bytes
• Number of blocks in main memory
• Number of lines in cache m 2r • Size of cache 2rw words or bytes • Size of tag (sr ) bits
The effect of this mapping is that blocks of main memory are assigned to lines of the cache as follows:
Thus, the use of a portion of the address as a line number provides a unique mapping of each block of main memory into the cache. When a block is actually read into its assigned line, it is necessary to tag the data to distinguish it from other blocks that can fit into that line. The most significant srbits serve this purpose.

Example 4.2a Figure 4.10 shows our example system using direct mapping.5 In the ex- ample, m 16K 214 and ijmodulo 214. The mapping becomes == =
4.3 / ELEMENTS OF CACHE DESIGN 127
WordL ineTag
WO W1 W2 W3
Compare
1 if match 0 if no match
0 if match 1 if no match
W4j W(4j+1) W(4j+2) W(4j+3)
Tag Data Cache
L0
Li
Memory address
(Miss in cache)
(Hit in cache)
w
s – r
wr
s + w
Main memory
Bj
B0
s
w
Lm–1
s – r
Figure 4.9 Direct-Mapping Cache Organization
Note that no two blocks that map into the same line number have the same tag num- ber.Thus,blocks with starting addresses 000000,010000, FF0000 have tag numbers 00, 01, FF, respectively. Referring back to Figure 4.5, a read operation works as follows.The cache system is presented with a 24-bit address.The 14-bit line number is used as an index into the cache to access a particular line.If the 8-bit tag number matches the tag number currently stored in that line,then the 2-bit word number is used to select one of the 4 bytes in that line.Oth- erwise, the 22-bit tag-plus-line field is used to fetch a block from main memory.The actual address that is used for the fetch is the 22-bit tag-plus-line concatenated with two 0 bits,so that 4 bytes are fetched starting on a block boundary. Á , Á ,
Cache Line Starting Memory Address of Block 0 000000, 010000, FF0000 1 000004, 010004, FF0004
214 1 00FFFC, 01FFFC, FFFFFC Á ,- oo Á , Á ,
5In this and subsequent figures, memory values are represented in hexadecimal notation. See Chapter 19 for a basic refresher on number systems (decimal, binary, hexadecimal).
Note: Memory address values are in binary representation; other values are in hexadecimal
The direct mapping technique is simple and inexpensive to implement. Its main disadvantage is that there is a fixed cache location for any given block.Thus,if a program happens to reference words repeatedly from two different blocks that map into the same line,then the blocks will be continually swapped in the cache,and the hit ratio will be low (a phenomenon known as thrashing).

đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Bởi vì có những dòng bộ nhớ cache ít hơn khối bộ nhớ chính, một thuật toán là cần thiết cho việc lập bản đồ các khối bộ nhớ chính vào dòng bộ nhớ cache. Hơn nữa, một phương tiện cần thiết cho việc xác định khối bộ nhớ chính hiện đang chiếm một dòng bộ nhớ cache. Việc lựa chọn các chức năng lập bản đồ ra lệnh như thế nào bộ nhớ cache là kỹ thuật organized.Three có thể được sử dụng: trực tiếp, kết hợp, và thiết lập associative.We kiểm tra mỗi lần lượt. Trong mỗi trường hợp, chúng ta nhìn vào cấu trúc chung và sau đó là một ví dụ cụ thể.
Ví dụ 4.2 Đối với tất cả ba trường hợp, ví dụ bao gồm các yếu tố sau:
• Các bộ nhớ cache có thể giữ 64 KBytes. • Dữ liệu được chuyển giao giữa bộ nhớ chính và bộ nhớ cache trong khối 4 byte mỗi. Điều này có nghĩa là bộ nhớ cache được tổ chức như 16K 214 dòng 4 byte mỗi. • Bộ nhớ chính bao gồm 16 Mbytes, với mỗi byte địa chỉ trực tiếp bởi một địa chỉ 24-bit (224 16M) .Thus, cho mục đích lập bản đồ, chúng ta có thể xem xét chính vieân ory để bao gồm 4M khối 4 byte mỗi.
BẢN ĐỒ TRỰC TIẾP Các kỹ thuật đơn giản nhất, được gọi là bản đồ trực tiếp, bản đồ mỗi khối của bộ nhớ chính vào chỉ có một dòng bộ nhớ cache có thể. Các bản đồ được Thí ép như
nơi
tôi nhớ cache dòng số j chính khối bộ nhớ số số m dòng trong bộ nhớ cache
hình 4.8a cho thấy các bản đồ cho các khối đầu tiên của bộ nhớ chính. Mỗi khối của bộ nhớ chính bản đồ thành một dòng duy nhất của các khối tiếp theo cache.The của bản đồ bộ nhớ chính vào bộ nhớ cache trong cùng một thời trang; đó là, khối Bm bộ nhớ chính vào bản đồ đường L0 của bộ nhớ cache, khối Bm? 1 bản đồ vào dòng L1, và như vậy. Các chức năng lập bản đồ được thực hiện dễ dàng bằng cách sử dụng địa chỉ bộ nhớ chính. Hình 4.9 minh họa cơ chế chung. Đối với mục đích truy cập bộ nhớ cache, mỗi địa chỉ bộ nhớ chính có thể được xem như bao gồm ba lĩnh vực. Các đáng kể không nhất w bit xác định một từ duy nhất hoặc byte trong một khối của bộ nhớ chính; trong hầu hết các máy hiện đại, địa chỉ là ở level.the byte bit còn lại của chỉ định một trong 2s khối chính luận memory.The bộ nhớ cache diễn giải các s bit như một thẻ của srbits (phần quan trọng nhất) và một trường dòng r bits.This lĩnh vực sau iden- tifies một trong những dòng m 2r của cache.To tóm tắt,
chiều dài • Địa ​​chỉ (sw) bit • Số lượng các đơn vị địa chỉ? 2s? Chữ w hoặc byte • Block kích thước kích thước đường 2w từ hay byte
• Số lượng các khối trong bộ nhớ chính
• Số dòng trong bộ nhớ cache m 2r • Kích thước của bộ nhớ cache 2r? chữ w hoặc byte • Kích thước của thẻ (sr) bit
Hiệu quả lập bản đồ này là các khối bộ nhớ chính được giao cho dòng bộ nhớ cache như sau:
Như vậy, việc sử dụng một phần của địa chỉ như một số dòng cung cấp một bản đồ độc đáo của mỗi khối của bộ nhớ chính vào cache. Khi một khối được thực sự đọc vào dòng giao của nó, nó là cần thiết để khóa các dữ liệu để phân biệt nó với các khối khác mà có thể phù hợp với dòng đó. Các srbits quan trọng nhất phục vụ mục đích này. Ví dụ 4.2a Hình 4.10 cho thấy hệ thống ví dụ của chúng ta sử dụng trực tiếp mapping.5 Trong dụ, m 16K và 214 ijmodulo 214. Việc lập bản đồ trở nên == = 4.3 / CÁC YẾU TỐ CỦA CACHE DESIGN 127 WordL ineTag WO W1 W2 W3 So sánh 1 nếu trận đấu là 0 nếu không có trận đấu là 0 nếu trận 1 nếu không có trận đấu W4j W (4J + 1) W (4J + 2) W (4J + 3) Tag Data Cache L0 Li địa chỉ bộ nhớ (Miss trong bộ nhớ cache) (Hit trong cache) w s - r wr s + w Bộ nhớ chính Bj B0 s w Lm-1 s - r Hình 4.9 Tổ chức bộ nhớ cache Direct-Mapping Lưu ý rằng không có hai khối map vào số dòng tương tự có cùng một từ khóa num ber.Thus, khối với địa chỉ bắt đầu 000000,010000, FF0000 có số thẻ 00, 01, FF, tương ứng. Nhắc lại Hình 4.5, một hoạt động đọc các công trình như hệ thống cache follows.The được trình bày với một 24-bit address.The số dòng 14-bit được sử dụng như một chỉ số vào bộ nhớ cache để truy cập vào một line.If đặc biệt là 8-bit số thẻ phù hợp với số thẻ hiện đang được lưu trong dòng, sau đó từ thứ 2-bit được sử dụng để chọn một trong 4 byte trong đó line.Oth- erwise, lĩnh vực tag-plus-đường 22-bit được sử dụng để lấy một khối từ memory.The chính địa chỉ thực tế được sử dụng để tìm nạp là 22-bit tag-cộng-line nối với hai bit 0, do đó 4 byte được lấy bắt đầu trên một ranh giới khối. Á, Á, cache Dòng Bắt đầu từ địa chỉ bộ nhớ của Block 0 000000, 010000, FF0000 1 000.004, 010.004, FF0004 214 1 00FFFC, 01FFFC, FFFFFC Á, - oo Á, Á, 5in này và con số tiếp theo, giá trị bộ nhớ được biểu diễn trong hệ thập lục phân ký hiệu. Xem Chương 19 để bồi dưỡng cơ bản về hệ thống số (số thập phân, nhị phân, thập lục phân). Lưu ý: giá trị địa chỉ bộ nhớ là trong biểu diễn nhị phân; giá trị khác trong hệ thập lục phân Các kỹ thuật lập bản đồ trực tiếp là đơn giản và không tốn kém để thực hiện. Nhược điểm chính của nó là có một vị trí cố định bộ nhớ cache cho bất kỳ block.Thus nhất định, nếu xảy ra một chương trình để tham khảo từ nhiều lần từ hai khối khác nhau mà ánh xạ vào cùng một dòng, sau đó các khối sẽ tiếp tục được trao đổi trong bộ nhớ cache, và tỷ lệ trúng sẽ thấp (một hiện tượng gọi là đòn).


































đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: