Final answer:
This problem requires converting decimal memory addresses to binary, identifying the tag and index for a direct-mapped cache, and determining hits and misses for each reference.
Step-by-step explanation:
Cache memory operations and management are central to the performance of computer architecture. This problem involves understanding how the direct-mapped cache works, converting decimal addresses into binary, and determining cache hits and misses.
Part a)
In a direct-mapped cache with 16 one-word blocks, the memory address is split into tag and index. The index needs 4 bits (since there are 16 blocks, and 2^4 = 16) and the remaining higher order bits are the tag. A cache hit occurs if the current address's tag matches an address's tag already stored in the cache with the same index. Initially, the cache is empty, so the first reference will always be a miss.
For example, the word address 3 in binary is 00000000000000000000000000000011. With the least significant 4 bits as the index (0011), the tag would be the remaining bits (all zeros here). As the cache starts empty, this would be a miss. As references are processed, some will be hits if their tags and indices match any previously stored addresses.
Part b)
For a direct-mapped cache with two-word blocks and a total of 8 blocks, we have to take into consideration that each block now stores two words. The index field will now have 3 bits (since 2^3 = 8). Since the block size is two words, the lowest order bit of the address is used to determine the word within a block, and this bit is not part of the index.
As a result, the memory addresses will have their last bit ignored for the index and tag calculation (e.g., word address 3 becomes binary 11, and after dropping the least significant bit for the block offset, we are left with an index of 1 (binary 01) and the rest as the tag). Starting with an empty cache, each address will result in a miss initially and then we'll determine hits or misses based on whether the cache already has the block with the same tag and index.