Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. how to do question 5 of A5: the block size is 1
  2.  
  3. From the textbook, the set containing a block is the (block number) mod (number of sets in cache)
  4.  
  5. Direct mapped: Since there are 8 spaces in the cache, there are three "index" bits. In the table, they're not called index bits, they're represented by "Block". So Block 4 means all addresses which end in 100 -> eg 4 (0100) and 4 + 8 = 12 (1100). For example, if we get address 3 reference, then the binary is 0011, so we put this into the row in the table represented by "Block 3". Another way to see this is that (3 mod 8) = 3, where 3 is the "block number" (eg the address) and 8 is the number of sets in the cache.
  6.  
  7. 2-way set associative: Here, there are four sets. So the "index" bits are the two rightmost bits of the word addresses. Eg, for word address 13, which is 1101, it belongs in the row for set "01", 2. The tag bits come from the rest of the word address. Having already used the "01" in "1101" for the set, we use "11" as the tag bits. This allows you to differentiate between address 13 and 9, which would be 1001 in binary and thus will have "10" as the tag bits.
  8.  
  9. 4 and fully associative are the same logic. Note in fully associate, the "tag" bits are the entire word address.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement