Skip to main content

Cache organization

Short answer

Cache organization includes data memory for blocks, tag memory with valid and dirty bits, comparators for parallel tag comparison, and a controller for hit/miss logic, replacement, and write policy. The address is split into Tag, Line/Set, and Word fields. On a read hit, the word is sent to the CPU; on a miss, the block is fetched from main memory.

Explain cache organization.

Cache organization describes how the cache is arranged and connected so that it can store blocks and find them quickly.

   CPU <----> +------------------------------+ <----> Main
              |        CACHE                 |        memory
   address -->| Controller (hit/miss logic)  |
              |  +--------+  +------------+  |
              |  | Tag    |  | Data       |  |
              |  | memory |  | memory     |  |
              |  |V|D|tag |  | block data |  |
              |  +---+----+  +------+-----+  |
              |      v              |        |
              |  Comparator ----> hit/miss   |
              +------------------------------+
  • Data memory: stores blocks (lines) copied from main memory; one line holds several words.
  • Tag memory: stores the tag (high-order address bits) of each line, plus a valid bit and a dirty bit (for write-back).
  • Comparator: compares the address tag with the stored tag; a match with the valid bit set is a hit.
  • Controller: controls the read/write, block fetch on a miss, replacement and write policy.
  • Mapping: direct, associative or set associative decides where a block may be placed.
  • Address split: Tag | Line (or Set) | Word; the word field selects a word in the line.

On a read hit the word goes to the CPU; on a read miss the whole block is fetched from main memory and the word is forwarded to the CPU.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 6 questions →