Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 6.4, Problem 6.9PP

Explanation of Solution

Cache Addressing:

The primary storage hierarchy contains cache lines that are grouped into sets. If each set contains k lines then we say that the cache is k-way associative.

A data request has an address specifying the location of the requested data. Each cache-line sized chunk of data from the lower level can only be placed into one set. The set that it can be placed into depends on its address.

The number of cache sets is equal to the number of cache blocks divided by the number of ways of associativity.

Number of tag bits = (address _bit _length ) - (exponent _of_ index )  (exponent _of _offset)

The least significant bits are used to determine the block offset.

For example:

One needs to consider the following set associative (S, E, B, m) = (8, 4, 4, 13). The derived value will be as follows:

The Index (CI):

s=log2(S)   =log2(23) = 3 log2(2) = 3

The block off set (CO):

s = log2(B) = log2(22) = 2 log2(2) = 1

The tag bit (CT):

t = m - (s + b) = 13 - (3 + 2) = 13 - 5 = 8

Hence, the “2” lower bits are block offsets (CO); followed by 3 sets of bit index (CI) and the remaining bits are tag bits (CT).

The following table gives the parameters for a number of different caches and the number of cache sets(S), tag bits(t), set index bits (s) and block offset bits (b) are defined.

CachemCBEStsb
1321024412562282
232102484322453
3321024323212705

The values for the above table are described below:

For cache-1:

It is given that B=4,E=1, C=1024 and m=32.

Hence:

S=(cache_memory)/(B×E)=(1024)/(4×1)=256

s=log2(S)  =log2(256) = log2(28) = 8 log2(2) = 8

b =log2(B)=log2(4)=2

t = m - (s + b) = 32- (8 + 2) = 32-10 = 22

For cache-2:

It is given that B=8, E=4,C=1024 and m=32

Blurred answer
Students have asked these similar questions
1. Develop a mathematical model for measuring performance based on overall memory access time with a neat diagram for the following memory design and derive the formula to calculate the Overall Memory Access Time. Main Memory : 1 Internal Cache : 1 External Cache: 1 Register S and Register B have fastest access time: Data Search order [ Registers – Internal Cache – External Cache – Memory] [Hint: Register access time is considered negligible]
1. We wish to compare the performance of two different machines: M1 and M2. The following measurements have been made on these machines:   Program Time on M1 Time on M2 1 10 seconds 5 seconds 2 3 seconds 4 seconds Which machine is faster for each program, and by how much?   2. For M1 and M2 of problem 1, the following additional measurements are made:. Find the instruction execution rate (instructions per second) for each machine when running program 1.   Program Instructions executed on M1 Instructions executed on M2 1 200 x 106 160 x 106   3. For M1 and M2 of problem 1, if the clock rates are 200 MHz and 300 MHz, respectively, find the CPI for program 1 on both machines using the data provided in problems 1 and 2.   4. You are going to enhance a machine, and there are two possible improvements: either make multiply instructions run four times faster than before or make memory access instructions run two times faster than before. You…
Problem 4: Give a block diagram for a 8M x 32 memory using 512K x 8 memory ch book] [Hints: Figure 5.10 in the
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr