Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Consider a cache of 4 lines of 16 bytes each. Main memory is divided into blocks of 16 bytes each. That is, block 0

image text in transcribed

3. Consider a cache of 4 lines of 16 bytes each. Main memory is divided into blocks of 16 bytes each. That is, block 0 has bytes with addresses 0 through 15, block 1 has bytes with addresses 16 through 31, and so on. Consider a program that accesses memory in the following sequence of addresses: Once: Address 63 through address 68; Loop two times: address 15 through address 17; then address 32; then address 80 through address 82. Now answer the following: a. Suppose the cache is organized as direct mapped. Memory blocks 0, 4, 8, and so on are assigned to line 0; blocks 1,5, 9, and so on to line 1; and so on. Assume the cache is initially empty. For each of the address access in the program above, show the corresponding block number and cache line number and whether it is a hit or miss. The first address access is shown below for your reference. Compute the hit ratio for this case. (8 points) Address 63 Block No 3 Line No 3 Hit or miss Miss b. Suppose the cache is organized as two-way set associative, with two sets of two lines each. Even-numbered blocks are assigned to set 0 and odd-numbered blocks are assigned to set 1. Each set has two lines numbered as 0 and 1. First block to any set will go to line 0, next block in the same set will go to line 1, after that use the least recently used replacement scheme. Assume the cache is initially empty. For each of the address access in the program above, show the corresponding block number and cache set and line number and whether it is a hit or miss. Compute the hit ratio for the two-way set-associative cache. (10 points) Address 63 Block No 3 Set No 1 Line No 0 Hit or miss Miss

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Tell the merits and demerits of Mendeleev's periodic table.

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago