Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
237 views
in Computer by (78.8k points)
closed by
A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as 16-way set-associative cache, the length of the TAG field is _______ bits.

1 Answer

0 votes
by (79.1k points)
selected by
 
Best answer

Formula:

Cache size = N words

No. of bits to address cache size = log2N

Block size = B words

Block offset = log2B

No. of blocks in the cache = N/B

No. of bits to represent blocks = log2 (\(\frac{N}{B}\))

No. of sets in cache = (\(\frac{N}{B}\)) / 16

Bits to represent sets = log2 (\(\frac{N}{B}\)) / 16)

For direct mapper cache,

Tag (10)

Cache line

(log2 (\(\frac{N}{B}\)))

Block offset

(log2B)

 

For set associative cache,

Tag (Let, X)

Set No.

log2 (\(\frac{N}{B}\)) / 16)

Block offset

(log2B)

 

Here, direct mapped cache is compared with set associative cache, but in both the cases block offset is same so neglect it.

Calculation:

10 + log2 (\(\frac{N}{B}\)) = x + log2 (\(\frac{N}{B}\)) / 16)

10 + log2 (\(\frac{N}{B}\)) = x + log2 (\(\frac{N}{B}\)) – log2 16

10 = x – 4

X = 14

Tag bits for 16-bit set associative cache are 14.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...