Question:
A four-way set-associative cache memory unit with a capacity of \(32\text{ KB}\) is built using a block size of \(1\text{ K}\). The word length is \(8\text{ bits}\). The size of physical address space is \(32\text{ GB}\). The number of bits for the TAG field is:
चार-तरफा सेट-एसोसिएटिव (four-way set-associative) कैश मेमोरी यूनिट जिसकी क्षमता \(32\text{ KB}\) है, \(1\text{ K}\) के ब्लॉक आकार का उपयोग करके बनाई गई है। वर्ड की लंबाई \(8\text{ bits}\) है। भौतिक एड्रेस स्पेस (physical address space) का आकार \(32\text{ GB}\) है। TAG फ़ील्ड के लिए बिट्स की संख्या क्या है?
Options:
- 22
- 24
- 25
- 23
- 22
- 24
- 25
- 23
Correct Answer: a)
Explanation:
Step-by-step calculation:
1. Word length = \(8\text{ bits} = 1\text{ Byte}\), so memory is byte-addressable.
2. Physical Address Space = \(32\text{ GB} = 2^5 \times 2^{30}\text{ Bytes} = 2^{35}\text{ Bytes}\) \(\Rightarrow\) Total Physical Address = \(35\text{ bits}\).
3. Block size = \(1\text{ KB} = 2^{10}\text{ Bytes}\) \(\Rightarrow\) Block/Word offset = \(10\text{ bits}\).
4. Total cache capacity = \(32\text{ KB}\).
5. Number of cache lines/blocks = \(\frac{32\text{ KB}}{1\text{ KB}} = 32\).
6. For a 4-way set-associative cache, lines per set = 4. Number of sets = \(\frac{32}{4} = 8 = 2^3\) \(\Rightarrow\) Set index = \(3\text{ bits}\).
7. TAG bits = Total Address Bits \(- (\text{Set Index Bits} + \text{Block Offset Bits}) = 35 – (3 + 10) = 22\text{ bits}\).
चरणबद्ध गणना:
1. वर्ड की लंबाई = \(8\text{ bits} = 1\text{ बाइट}\), अतः मेमोरी बाइट-एड्रेसेबल है।
2. भौतिक एड्रेस स्पेस = \(32\text{ GB} = 2^{35}\text{ बाइट}\) \(\Rightarrow\) कुल फिजिकल एड्रेस = \(35\text{ bits}\)।
3. ब्लॉक आकार = \(1\text{ KB} = 2^{10}\text{ बाइट}\) \(\Rightarrow\) ब्लॉक ऑफ़सेट = \(10\text{ bits}\)।
4. कुल कैश क्षमता = \(32\text{ KB}\)।
5. कैश लाइनों की संख्या = \(\frac{32\text{ KB}}{1\text{ KB}} = 32\)।
6. 4-वे सेट-एसोसिएटिव कैश में सेट की संख्या = \(\frac{32}{4} = 8 = 2^3\) \(\Rightarrow\) सेट इंडेक्स = \(3\text{ bits}\)।
7. TAG फ़ील्ड के बिट्स = कुल एड्रेस बिट्स \(- (\text{सेट इंडेक्स} + \text{ब्लॉक ऑफ़सेट}) = 35 – (3 + 10) = 22\text{ bits}\)।