memory mappings into cache lines for chapter 5 homework problems 16-entry direct mapped cache with one word per line = 16 words total +--+ 0| | 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 ... 1| | 1 . . . 65 . . . . . 161 . . . . . 2| | 2 . . . . . . . . . 162 . . . . . 3| | . . . . . . . . . . . . . . . . 4| | . . . . . 84 . . . . . . . 212 . . 5| | . . . . . 85 . . . . . . . 213 . . 6| | 6 . . . . . . . 134 . . . . 214 . . 7| | . . . . . . . . 135 . . . . 215 . . 8| | . . . . . . . . . . . . . . . . 9| | . . 41 . . . 105 . . . . . . . . . 10/a| | . . . . . . . . . . . . . . . . 11/b| | . . . . . . . . . . . . . . . . 12/c| | . . 44 . . . . . . . . . . . . . 13/d| | . . . . . . . . . . . . . 221 . . 14/e| | . . . . . . . . . . 174 . . . . . 15/f| | . . . . . . . . . . 175 . . . . . ... +--+ tag: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... in hex a b c d e f 8-entry direct mapped cache with two words per line = 16 words total +----+ 0| | 0,1 16,17 32,33 48,49 64,65 80,81 96,97 112,113 128,129 1| | 2,3 . . . . . . . . 2| | . . . . . 84,85 . . . 3| | 6,7 . . . . . . . 134,135 4| | . . 40,41 . . . 104,105 . . 5| | . . . . . . . . . 6| | . . 44,45 . . . . . . 7| | . . . . . . . . . +----+ tag: 0 1 2 3 4 5 6 7 8 0: 144,145 160,161 176,177 192,193 208,209 224,225 240,241 ... 1: . 162,163 . . . . . 2: . . . . 212,213 . . 3: . . . . 214,215 . . 4: . . . . . . . 5: . . . . . . . 6: . . . . 220,221 . . 7: . 174,175 . . . . . ... tag: 9 10 11 12 13 14 15 ... in hex a b c d e f 4 entries per bank, 3-way set associative, two words per line = 24 words total +----+ +----+ +----+ 0| | | | | | 0,1 8,9 16,17 24,25 32,33 40,41 48,49 56,57 1| | | | | | 2,3 . . . . . . . 2| | | | | | . . . . . 44,45 . . 3| | | | | | 6,7 . . . . . . . +----+ +----+ +----+ tag: 0 1 2 3 4 5 6 7 0: 64,65 72,73 80,81 88,89 96,97 104,105 112,113 120,121 128,129 1: . . . . . . . . . 2: . . 84,85 . . . . . . 3: . . . . . . . . 134,135 tag: 8 9 10 11 12 13 14 15 16 in hex a b c d e f 10 0: 136,137 ... 160,161 168,169 ... 208,209 216,217 ... 1: . 162,163 . . . 2: . . . 212,213 220,221 3: . . 174,175 214,215 . ... tag: 17 ... 20 21 ... 26 27 ... in hex 11 14 15 1a 1b