retagged by
7,642 views
19 votes
19 votes
Consider a set-associative cache of size $\text{2KB (1KB} =2^{10}$ bytes$\text{)}$ with cache block size of $64$ bytes. Assume that the cache is byte-addressable and a $32$ -bit address is used for accessing the cache. If the width of the tag field is $22$ bits, the associativity of the cache is _________
retagged by

5 Answers

Best answer
18 votes
18 votes

$32$ bit address is used for accessing the cache.

It is given that cache is Set-Associative.

The address bits get split as follows:

Block Size $= 64 B \implies$ Block offset $= 6\; bits.$

Given that Tag field width $= 22\; bits.$

Therefore, width of Set Index field  $= 32-22-6 = 4 \implies 2^4\text{ = 16 sets in the cache.}$

Cache size is $2 KB$ and Block size $= 64 B$  $\implies 2^5 \text{ = 32 blocks present in the cache. }$

$16$ sets contain $32$ blocks  $\implies 2$ blocks per set or associativity $=2.$

Correct Answer: $2$

edited by
7 votes
7 votes

Associativity is $2$

 

7 votes
7 votes
$\text{Tag field width} = \log_2(\text{Address Space})- \log_2 (\text{cache size}) + \log_2(\text{associativity})$  

$\implies 22 = 32 – 11 + \log_2(\text{associativity}) $

$\implies 1 = \log_2(\text{associativity})$

$\implies \text{associativity} = 2^1 = 2.$
edited by
0 votes
0 votes
Given, Set associative cache and cache is byte Addressable

tag size =22bit

Cache size= 2KB

Cache Block size =64Byte =2^6 Byte

Byte offset =6bit

Number of line in cache  = cache size / Block size

                                            = 2 * 2^10/ 2^6

Number of lines in cache= 2^5

32 bit address are use so

32 bit =tag bit + number of set + byte offset

32 bit         = 22 bit + number of set + 6bit

number of set = 4bit

number of sets in cache = number of line in cache / P-way

P-way = number of line in cache / number of sets in cache

           =2^5/ 2^4

           =2
Answer:

Related questions

8.3k
views
2 answers
18 votes
Arjun asked Feb 18, 2021
8,296 views
​​​​​​Assume a two-level inclusive cache hierarchy, $L1$ and $L2$, where $L2$ is the larger of the two. Consider the following statements.$S_1$: Read misses i...
11.7k
views
3 answers
24 votes
Arjun asked Feb 18, 2021
11,731 views
Consider a computer system with $\text{DMA}$ support. The $\text{DMA}$ module is transferring one $8$-bit character in one $\text{CPU}$ cycle from a device to memory thro...
16.0k
views
4 answers
23 votes
Arjun asked Feb 18, 2021
15,974 views
Consider a pipelined processor with $5$ stages, $\text{Instruction Fetch} (\textsf{IF})$, $\text{Instruction Decode} \textsf{(ID)}$, $\text{Execute } \textsf{(EX)}$, $\te...
11.5k
views
3 answers
14 votes
Arjun asked Feb 18, 2021
11,478 views
Consider a complete binary tree with $7$ nodes. Let $A$ denote the set of first $3$ elements obtained by performing Breadth-First Search $\text{(BFS)}$ starting from the ...