Exercise Link
-
The link to the exercise for students: Direct Mapped Cache Exercise
Instuctions/Suggestions for Use
This exercise presents students with one of our process "ask me another" runestone components from the Chapter 11 textbook exercises. This exercise version of the component has been set up with a common starting point question and includes instructions for students to follow.
This component question consists of a table showing the state of a direct-mapped cache. It provides students with a sequence of addresses corresponding to read and write operations, and it asks them to demonstrate how each memory access affects the state of the direct mapped cache (if it is a hit or miss, which cache line it accesses, and cache line metadata values). The component displays one address read or write operation at a time, and then updates the state of the cache with the result of that operation after each correct answer.
The exercise starts with a fixed question that every student sees, with guided steps for the students to follow along to solve it. After solving the initial question, the instructions ask students to click the “Generate another question” button, which generates a new question of the same type for them to solve.
Note these features of this component as students work on this exercise:
-
The “Generate another question” feature procedurally generates new questions that are different across users.
-
The "Help" button provides instructions for the user.
When to Use
This is an exercise that is best suited for coverage with section 11.4 of the textbook. It reinforces:
-
the structure of direct mapped caches.
-
how the bits in a memory address are used to access a direct map cache and determine hits and misses.
-
how cache metadata are used and updated by memory accesses.
-
how a series of memory accesses results in data being added to or ejected from the cache.
How to use
You can deliver this exercise without demo’ing the component first, the preferred way, or you can demo the component to the students first, and then have them try out the exercise. If you demo the component, please demo the version with the Chapter 11 textbook exercises rather than demo’ing this exercise version one, as the starting exercise question and its instructions to students are fixed in the provided exercise. The "generate another question" feature will then generate new unique instances after this common starting question.
One suggestion is to have students:
-
Read through (or you can read through) the exercise instructions before starting.
-
Try the activity.
The link to the exercise for students: Direct Mapped Cache Exercise
Contact us
Please contact the Dive into Systems authors at authors@diveintosystems.org, with any typos, feedback, or questions about exercise.