Consider the following cache system: Memory 256 or 21 bytes, Cache size 128 or 2
ID: 3835146 • Letter: C
Question
Consider the following cache system: Memory 256 or 21 bytes, Cache size 128 or 2^7 bytes, and Block size 16 or 2^4 bytes (a) Memory data [0x26] is positioned in the "2"-nd (actually 2 + 1 or 3^rd) block in memory. Likewise, memory data [0xA6] is positioned m the "A"-th (actually A + l or 11^th) block m memory. Mark the position of memory data addressed by [0x26] and [0xA6] m memory (figure on the left). (b) Mark the position of memory data addressed by [0x26] and [0xA6] m cache (figure on the right). (c) Since a cache block is 16 bytes, the "offset" within the block (or called block offset) can be 0 (0000) ~15 (1111). In other words, the block offset is represented by the last __ bit(s) of a memory address. Block offset of memory data [0x26] (00100110) and [0xA6] (10100110) is therefore ___ and ____, respectively, in binary format. (d) Since there are 8 cache blocks, the "block index' ranges from 0 (000) to 7 (111). In other words, the block index is represented by the next ___ bit(s) of a memory address. Block index of memory data [0x26] (00100110) and [0xA6] (10100110) is therefore ___ and ___, respectively, in binary format.Explanation / Answer
Memory = 256 Bytes or 28 Bytes
Cache = 128 Bytes or 27 Bytes
Block Size = 16 Bytes or 24 Bytes
so, last 4 bits are offset and bits number 1-3 are represent their location in Cache Block.
a. 0x26 - 20 Block of memory
0xA6 - A0 Block of memory
b. 0x26 - 2 Block of Cache (Bits representation - 0010 0110)
0xA6 - 2 Block of Cache(bits representation - 1010 0110)
As both 1-3 bits are 010 -- Cache block number 010 i.e 2
c. last 4 bits, 0110 and 0110 respectively
d. next 3 bits, therefore 010 and 010 respectively.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.