COMPUTER SCIENCE AND ENGINEERING
COMPUTER ARCHITECTURE
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
8 bits
|
|
12 bits
|
|
16 bits
|
|
32 bits
|
Detailed explanation-1: -AI Recommended Answer: There are 2^32 = 4, 294, 967, 296 total bits in a 32-bit address. Therefore, the required number of bits for a direct-mapped cache with 16 KB of data and 4-word blocks is 2^32 + 4 = 4, 294, 967, 296.
Detailed explanation-2: -You have 16 kB = 16*1024 = 16384 bytes of data . Since word has 4 bytes, this makes 16384 bytes / 4 bytes per word = 4096 words . Block size is 4 words, that makes 4096 words/4 words per block = 1024 (2^10) blocks . This means 10 bits are used for the index.
Detailed explanation-3: -A direct-mapped cache is the simplest approach: each main memory address maps to exactly one cache block. For example, on the right is a 16-byte main memory and a 4-byte cache (four 1-byte blocks). Memory locations 0, 4, 8 and 12 all map to cache block 0. Addresses 1, 5, 9 and 13 map to cache block 1, etc.