# Query Regarding Direct cache mapping [closed]

Thank you for looking into this, I have a problem regarding direct cache mapping, My problem really though is with the question formation itself and the problem I am about to present seems to have inconsistency and has unclear description. So the problem is as follows ( I am presenting exactly as given )

32 bit architecture
Main memory size = 8GB
cache size = 512KB
Block size = 32 words

To Find

1. Number of bits required for Byte Offset = ?
2. Number of bits required for main memory address = ?
3. Number of bits required for main memory block number = ?
4. Cache Index bits = ?
5. Tag-bits = ?
6. Size of Tag Directory = ?

Now My Interpretation of the solution is as follows

• What's your question? If you think the exercise you were set is confusing or inconsistent, you should contact whoever set that exercise for you, not us; we can't resolve that for you. If you're asking us to check whether your solution is correct, we discourage those kinds of questions. Our mission is to build up questions and answers that will be useful to others in the future - is there a conceptual question you can ask that will be useful even to others who aren't looking at that exact exercise?
– D.W.
Jan 23, 2021 at 3:46
• @D.W. What I am asking here is, is my interpretation of solution right? Or am I making a mistake somewhere, also I can't ask the one who gave exercise no matter how much I want to. Jan 23, 2021 at 12:53
• Please credit the original source of all copied material. We discourage "is my solution correct?" questions, as they are unlikely to be of any use to anyone else in the future.
– D.W.
Feb 3, 2021 at 0:53

1. Block size is $$32 \text{words} = 2^5$$ . That, means that you need, 5 bits for offset.
2. $$\#\text{blocks}=\frac{2^{19}}{2^5}=2^{14}$$, so you need 14 bits for the index ( to indentify which block in cache is going to represent your wanted memory adresss )
3. For a 32 - bit adress, tag is the rest : $$32 - 14- 5 = 13$$ bits.