Asume 512 Bytes direct-mapped cache with 64 Byte cache blocks (cache line size), is empty at the beginning and below given set of physical addresses are referred by CPU in the given order. At each physical address request, state whether it will be a cache hit or miss in the given cages. Note that all the addresses are given in decimal numbering format. The answer for the first address reference is given as an example.
So I have done like it like this.Since cache have 512 bytes I have divided it by the size of the cache block.Then I will got 8 as the answer.So when CPU asked 1015 address it loaded 1015 and 1015+8 address into the cache and so on.So when cpu request address 1023 in the order of 3 since it was already loaded into cache in the previous step it is a cache hit.Is this the correct way of doing this? Point me if I am wrong.thank you