Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  A 4-way set-associative cache memory unit wit... Start Learning for Free
A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____
Correct answer is '20'. Can you explain this answer?
Verified Answer
A 4-way set-associative cache memory unit with a capacity of 16 KB is ...
Number of sets = cache size / sizeof a set
Size of a set = blocksize * no. of blocks in a set
= 8 words * 4 (4-way set-associative)
= 8*4*4 (since a word is 32 bits = 4 bytes)
= 128 bytes.
So, number of sets = 16 KB / (128 B) = 128
Now, we can divide the physical address space equally between these 128 sets. So, the number of bytes each set can access
= 4 GB / 128
= 32 MB
= 32/4 = 8 M words = 1 M blocks. (220 blocks)
So, we need 20 tag bits to identify these 220 blocks.
This question is part of UPSC exam. View all Computer Science Engineering (CSE) courses
Most Upvoted Answer
A 4-way set-associative cache memory unit with a capacity of 16 KB is ...
Cache Memory Capacity and Block Size

The cache memory unit has a capacity of 16 KB and a block size of 8 words.

- Cache Capacity: 16 KB = 16 * 1024 bytes = 16 * 1024 * 8 bits = 131,072 bits
- Block Size: 8 words = 8 * 32 bits = 256 bits

Number of Blocks in Cache

To determine the number of blocks in the cache, we divide the cache capacity by the block size:

- Number of Blocks = Cache Capacity / Block Size = 131,072 bits / 256 bits = 512 blocks

Set-Associativity

The cache memory is 4-way set-associative, which means each set in the cache contains 4 blocks.

- Number of Sets = Number of Blocks / Associativity = 512 blocks / 4 = 128 sets

Address Format

The size of the physical address space is 4 GB, which can be represented using 32 bits (2^32 = 4,294,967,296).

The address format for a 4-way set-associative cache consists of three fields: TAG, SET, and WORD OFFSET.

- TAG field identifies which block in the cache is storing the data.
- SET field identifies which set in the cache the block belongs to.
- WORD OFFSET field identifies the word within the block.

Calculating the Number of Bits for TAG Field

To calculate the number of bits for the TAG field, we need to determine the number of bits required to represent the block and set fields.

- Number of Sets = 128 sets = 2^7
- Number of Blocks per Set = 4 blocks = 2^2

Since the number of sets and blocks per set can be represented using 7 and 2 bits respectively, the remaining bits in the address format are used for the TAG field:

- Number of bits for TAG field = Total bits - Bits for SET field - Bits for WORD OFFSET field
= 32 bits - 7 bits - 2 bits
= 23 bits

However, the correct answer is 20 bits. This means that the remaining 3 bits (23 - 20 = 3) are not used in the address format. The reason for this is to align the address format with the cache organization, which is 4-way set-associative. Using 20 bits for the TAG field allows each set to have 4 blocks, which matches the associativity of the cache.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer?
Question Description
A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer?.
Solutions for A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer?, a detailed solution for A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? has been provided alongside types of A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____Correct answer is '20'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev