2
$\begingroup$

In my university class, I received this homework assignment on computer architecture, but I don't know how to solve it. I already know that the correct answer is 0, but I don't understand why. Could someone help me?

Problem: The byte-addressable memory has a 16-bit address. The directly addressed cache has 7-bit tags and 8-byte rows. You need to provide the cache row address if the memory address is #8614. The result should be given in hexadecimal, omitting the # sign.

$\endgroup$

1 Answer 1

2
$\begingroup$

If I understand correctly, your directly-mapped cache has 128 cache lines of 8 bytes. So, in a memory address, the 3 least significant bits (bits [0:3]) are used to compute the location inside the cache line while the rest of the bits are used to target a specific cache line inside the cache. I can only assume that the 7 next bits (bits [3:10]) are used for this purpose. Therefore, memory address #8614 corresponds to byte 4 in cache line #42, because #8614 % 8 = 4 and (#8614 // 8) % 128 = #42.

$\endgroup$
2
  • $\begingroup$ Let me add that we all know that 42 is always the answer. $\endgroup$ Commented Jan 22, 2024 at 5:52
  • $\begingroup$ What are cache tags for? Please add to your answer: How did you compute the number of cache line address bits, the number of cache lines? $\endgroup$ Commented Jan 22, 2024 at 7:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.