Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider a computer with a 4-ways set-associa... Start Learning for Free
Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.
The number of bits in the TAG, SET and WORD fields, respectively are:
  • a)
    7, 6, 7
  • b)
    8, 5, 7
  • c)
    8, 6, 6
  • d)
    9, 4, 7
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Consider a computer with a 4-ways set-associative mapped cache of the ...
Number of cache blocks = 8KB/(128*1) = 64
Number of sets in cache = Number of cache blocks/ 4 (4-way set)
= 64 / 4 = 16
So, number of SET bits required = 4 (as 24 = 16, and with 4 bits we can get 16 possible outputs) We can now straight away choose (D) as answer but for confirmation can proceed further.
Since, only physical memory information is given we can assume cache is physically tagged (which is anyway the common
case even in case of virtual memory). So, we can divide the physical memory into 16 regions so that, each set maps into only its assigned region. So, size of a region a set can address = 1MB/16 = 216 Bytes = 21 6 /128 = 29 cache blocks (as cache block size is 128 words = 128 bytes). So, when an access comes to an cache entry, it must be able to determine which out of the 29 possible physical block it is. In short it needs 9 bits for TAG.
Now, cache block size is 128 words and so to identify a word we need 7 bits for WORD.
This question is part of UPSC exam. View all Computer Science Engineering (CSE) courses
Most Upvoted Answer
Consider a computer with a 4-ways set-associative mapped cache of the ...
Explanation:

Given data:
Total main memory size = 1 MB = 2^20 bytes
Word size = 1 byte
Block size = 128 words
Cache size = 8 KB = 2^13 bytes

Number of blocks in the cache = Cache size/Block size = 2^13/2^7 = 2^6
Each block in the cache can hold 128 words = 2^7 bytes
Therefore, cache can hold 2^6 * 2^7 = 2^13 bytes

Number of sets in the cache = Cache size/(Block size * Associativity) = 2^13/(2^7 * 4) = 2^9
Number of blocks in each set = Associativity = 4

Hence, the number of bits in the TAG, SET, and WORD fields are as follows:

- TAG bits: Total address bits - (SET bits + WORD bits)
- SET bits: log2(Number of sets)
- WORD bits: log2(Word size)

Calculating the number of bits for each field:

- WORD bits = log2(1 byte) = 0
- SET bits = log2(2^9) = 9
- TAG bits = Total address bits - SET bits - WORD bits = log2(2^20) - 9 - 0 = 11 - 9 = 2^2 = 4

Since each block in the cache can hold 128 words, which is greater than the word size of 1 byte, we do not need any bits for the offset within a block.

Therefore, the number of bits in the TAG, SET, and WORD fields are:

- TAG bits = 4
- SET bits = 9
- WORD bits = 0

The correct answer is option D.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer?
Question Description
Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. 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 Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. 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 Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer?.
Solutions for Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. 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 Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.The number of bits in the TAG, SET and WORD fields, respectively are:a)7, 6, 7b)8, 5, 7c)8, 6, 6d)9, 4, 7Correct answer is option 'D'. 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