0
$\begingroup$

My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by Intermation, read the textbook, and even asked my friend (the Professor's office hours are not today). The textbook our Professor gave us does not have examples similar to the questions in the assignment. Given an address and the mapping scheme, and told which bits are used for what, I can map it to a value in the cache.

Here are the questions I don't know how to do:

  1. Assume a 2-way set associative cache with 4 one word blocks. Consider the following word address sequence:

0, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0

a. Assuming an LRU replacement policy, which accesses are hits?

b. Assuming an MRU (most recently used) replacement policy, which accesses are hits?

c. Describe an optimal replacement policy for this sequence, which accesses are hits using this policy?

  1. Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address references, given as word addresses.

0x03, 0xb4, 0x2b, 0x02, 0xbf, 0x58, 0xbe, 0x0e, 0xb5, 0x2c, 0xba, 0xfd

a. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 16 one-word blocks. List if each reference is a hit or a miss, assuming the cache is initially empty.

b. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 8 two-word blocks. List if each reference is a hit or a miss, assuming the cache is initially empty.

P.S. If you think this is cheating, I'll happily take this question down.

$\endgroup$
1
  • $\begingroup$ I've completed the assignment, but I don't know if my answers are right. I'm still confused. $\endgroup$ Apr 9, 2023 at 16:39

1 Answer 1

1
$\begingroup$

This community is not for assignment solving. Anyway, I will drop some hints that should help you get started.

  1. Cold Misses: It happens when your cache does not contain any block, typically after the system is powered on.

  2. Counters: These are separate structures associated with each block, that can be used to track down usage patterns.

Hope that helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.