Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) A cache has the following parameters: b, block size given in numbers of word

ID: 3824423 • Letter: #

Question

(a) A cache has the following parameters: b, block size given in numbers of words; S, number of sets; N, number of ways; and A, number of physical address bits. Provide an expression for the cache's byte capacity, C, in terms of the parameters provided Provide an expression for the total number of bits required for the tag storage array in terms of the parameters provided. Assume parameters S and b are powers of two. What are S and N for a fully associative cache of word capacity C with block size of b words? What is S and N for a direct mapped cache of word capacity C with block size of b words?

Explanation / Answer

1.Cache Basics:

a)Cache organized as a two dimensional array of blocks.

Parameter:

->block size(in number of words),b.

->number of sets, S: rows are called sets.

->number of ways, N: columns are called ways.

->number of physical address bits,A.

                                TAG                       SET              OFFSET

                                t-bits                    s-bits           b-bits

<- -------------- Address bits ------------------ ->

->At one extreme there is only one set, called fully -associative cache.

Fully-associative cache:

for fully associative cache the set field does not exits, because there is only one set.

Direct-mapped cache:

for direct mapped cache, if the set width is s bits it holds 2^S blocks.

->if block size is B, then b= log2(B) bits will be needed in the address to specify the block offset.

->if S is the number of set, then set index s=log2(S) bits

->if A is the length of address in bits , then number of tags bits is t= a-b-s.

->size of each cache = number of set * number of line in set * block size (words)

size of main memory, mm =no of block in memory *size of each block (words)

cache capacity =size of each cache   and size of MM