CPU Cache - Cache Entry Structure

Cache Entry Structure

Cache row entries usually have the following structure:

tag data block flag bits

The data block (cache line) contains the actual data fetched from the main memory. The tag contains (part of) the address of the actual data fetched from the main memory. The flag bits are discussed below.

The "size" of the cache is the amount of main memory data it can hold. This size can be calculated as the number of bytes stored in each data block times the number of blocks stored in the cache. (The number of tag and flag bits is irrelevant to this calculation, although it does affect the physical area of a cache).

An effective memory address is split (MSB to LSB) into the tag, the index and the block offset.

tag index block offset

The index describes which cache row (which cache line) that the data has been put in. The index length is bits. The block offset specifies the desired data within the stored data block within the cache row. Typically the effective address is in bytes, so the block offset length is bits. The tag contains the most significant bits of the address, which are checked against the current row (the row has been retrieved by index) to see if it is the one we need or another, irrelevant memory location that happened to have the same index bits as the one we want. The tag length in bits is .

Some authors refer to the block offset as simply the "offset" or the "displacement".

Read more about this topic:  CPU Cache

Famous quotes containing the words entry and/or structure:

    When women can support themselves, have entry to all the trades and professions, with a house of their own over their heads and a bank account, they will own their bodies and be dictators in the social realm.
    Elizabeth Cady Stanton (1815–1902)

    I’m a Sunday School teacher, and I’ve always known that the structure of law is founded on the Christian ethic that you shall love the Lord your God and your neighbor as yourself—a very high and perfect standard. We all know the fallibility of man, and the contentions in society, as described by Reinhold Niebuhr and many others, don’t permit us to achieve perfection.
    Jimmy Carter (James Earl Carter, Jr.)