

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Direct mapped caches. 1. How many bytes of data can our cache hold? 8 bytes How many words? 2 words. 2. Fill in the “Tag bits, Index bits, Offset bits” with ...
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


In the following diagram, each block represents 8 bits (1 byte) of data. Our memory is byte-addressed , meaning that there is one address for each byte. Compare this to word-addressed , which means that there is one address for each word.
Main Memory ... 6 5 4 3 2 1 0 Cache Number Main Memory 0
Cache Index Number Offset 3 2 1 0 0 1 Tag bits Index bits Offset bits Total 29 1 2 32 1 word= 4 bytes= 32 bits Index bits=log 2 (Number of index rows) Offset bits=log 2 (Number of offsets columns)
Assume we have the following cache. Classify each of the following byte memory accesses as a cache hit (H), cache miss (M), or cache miss with replacement (R). CPU Cache Index Number Offset 7 6 5 4 3 2 1 0 0 1 2 3
#define NUM_INTS 8192 int A[NUM_INTS]; /** A lives at 0x100000 / int i, total = 0; for (i = 0; i < NUM_INTS; i += 128) { A[i] = i; } /* Line 1 / for (i = 0; i < NUM_INTS; i += 128) { total += A[i]; } /* Line 2 */ Let’s say you have a byte-addressed computer with a total address space of 1MiB. It features a 16KiB CPU cache with 1KiB blocks.