Page 159 -
P. 159
130 CHAPTER 4 / CACHE MEMORY
Example 4.2b Figure 4.12 shows our example using associative mapping. A main mem-
ory address consists of a 22-bit tag and a 2-bit byte number.The 22-bit tag must be stored
with the 32-bit block of data for each line in the cache. Note that it is the leftmost (most
significant) 22 bits of the address that form the tag. Thus, the 24-bit hexadecimal address
16339C has the 22-bit tag 058CE7.This is easily seen in binary notation:
memory address 0001 0110 0011 0011 1001 1100 (binary)
1 6 3 3 9 C (hex)
tag (leftmost 22 bits) 00 0101 1000 1100 1110 0111 (binary)
0 5 8 C E 7 (hex)
Main memory address (binary)
Tag Word
Tag (hex) Data
000000 000000000000000000000000 13579246
000001 000000000000000000000100
Line
Tag Data Number
3FFFFE 11223344 0000
058CE7 FEDCBA98 0001
058CE6 000101100011001110011000
058CE7 000101100011001110011100 FEDCBA98
058CE8 000101100011001110100000
3FFFFD 33333333 3FFD
000000 13579246 3FFE
3FFFFF 24682468 3FFF
22 bits 32 bits
16K line cache
3FFFFD 111111111111111111110100 33333333
3FFFFE 111111111111111111111000 11223344
3FFFFF 111111111111111111111100 24682468 Note: Memory address values are
in binary representation;
32 bits other values are in hexadecimal
16-MByte main memory
Tag Word
Main memory address =
22 bits 2 bits
Figure 4.12 Associative Mapping Example

