Learn

Nice job reaching the end of this lesson! Here is a summary of the topics we covered:

  • Including cache memory in the memory hierarchy helps bridge the processor-memory performance gap.
  • Copies of data are stored in the cache to give the processor quicker access to the data compared to the main memory.
  • A cache hit is when requested data is located in the cache.
  • A cache miss is when requested data is not located in the cache and the data must be retrieved from the main memory.
  • A cache replacement policy defines what entry in cache will be replaced by new data.
  • Cache associativity assigns main memory locations to specified cache entries.
  • A cache write policy defines how data is written back down the memory hierarchy.

Instructions

The Cache() class is complete for this lesson, but more can be done. Here are some ideas:

  • Add the LRU replacement policy
  • Implement the write-back policy
  • Create a 2nd cache between this cache and the main memory.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?