Hey guys, so I have a question about actually calculating the size of the three fields and what cache block a hex number addresses. We're working with fully associative, direct mapped, and 2-way. It all went pretty fast and over my head but I don't think anything is too complicated, just a lot of work with exponents. Oh, there's also something about a valid bit? I think it's to determine if that's the memory block you want or not. So here's an example I pulled out from class,

Suppose a computer using direct mapped cache has 2^20
words of main memory and a cache
of 32 blocks, where each cache block contains 16 words.

a) How many blocks of main memory are there?

b) What are the sizes of the tag, block, and word fields?

c) To which cache block will the memory address 0DB6316 map?

Is a) 20? I'm sorry, I understand the basics of what cache memory does and the differences between the three, I just don't quite get the calculations.

Nevermind, I found a really great powerpoint online that explained the process. I would still like to know the answer to A if anyone could help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.