"Trace how cache is used when a program accesses the following series of addresses in order"

Discussion in 'Homework Help' started by Gonzalo Armbrust, Jul 10, 2015.

  1. Gonzalo Armbrust

    Thread Starter New Member

    Jun 28, 2015
    16
    0
    I have been encountering some difficulty understanding how to trace cache when accessing a series of addresses, the following is an example problem:


    "Suppose we have a byte-addressable computer with a cache that holds 8 blocks of 4 bytes each. Assuming that each memory address has 8 bits and cache is originally empty, for each of the cache mapping techniques, direct mapping, fully associative and 2-way associative, trace how cache is used when a program accesses the following series of addresses in order: 0x01,0x04,0x09,0x05,0x14 and 0x01"

    I'm struggling with how the 2-way associative mapping is set up, I understand that the first block in each set is filled first with memory, so 0x00 - 0x03 would be in set 1, first block,

    0x04-0x07 would be in the second set, first block

    0x08 - 0x0B would be in the first block third set

    and 0x0c to 0x0f would be in the first block, 4th set


    however, I am confused by the second block of the first set, wouldn't 0x10-0x13 be stored since that what is followed by the hexadecimal numbering system as opposed to 0x20 - 0x23??

    I am not sure if I am understanding this correctly, I have attached pictures to help clarify.
     
Loading...