# Direct Cache Mapping Hit Or Miss

I am have a difficult time understanding when a direct map cache is a hit or a miss. My understanding is that when and index matches, but a tag doesn't it is still a miss but the new tag then takes over the previous tag on that index.

Address  Binary Address   Tag       Index   H/M

3        00000011        0000        011    Miss
180      10110100        1011        100    Miss
43       00101011        0010        011    Miss
2        00000010        0000        010    Miss
191      10111111        1011        111    Miss
88       01011000        0101        000    Miss
190      10111110        1011        110    Miss
14       00001110        0000        110    Miss
181      10110101        1011        101    Miss
44       00101100        0010        100    Miss
186      10111010        1011        010    Miss
253      11111101        1111        101    Miss


As such my theory is that all of the mappings are misses, am I correct?

Thank you so much guys!

• The block size is one word; therefore we use no offset bit

• The total size is 8 blocks; therefore we need only 3 index bits

• The tag should be the 5 top bits, not just the top 4. Nonetheless, it looks like (assuming the cache starts out empty) you are correct that everything in the example is a miss. – Wandering Logic Dec 7 '14 at 13:15
• Thank you @WanderingLogic, I really appreciate your help! Can you elaborate why the tag requires 5 bits as opposed to 4? Or when I change it in general? – Nathan_Sharktek Dec 7 '14 at 13:44
• @WanderingLogic Can you take a look at my caching hit/miss question? cs.stackexchange.com/questions/43235/… – committedandroider Jun 4 '15 at 16:01