Docsity

cache memory function, Slides of Computer Architecture and Organization

Partial preview of the text

Download cache memory function and more Slides Computer Architecture and Organization in PDF only on Docsity!

William Stallings Computer Organization and Architecture 8th Edition Chapter 4 Cache Memory

Characteristics

  • (^) Location
  • (^) Capacity
  • (^) Unit of transfer
  • (^) Access method
  • (^) Performance
  • (^) Physical type
  • (^) Physical characteristics
  • (^) Organisation

Capacity

  • (^) Word size —The natural unit of organisation
  • (^) Number of words —or Bytes

Unit of Transfer

  • (^) Internal —Usually governed by data bus width
  • (^) External —Usually a block which is much larger than a word
  • (^) Addressable unit —Smallest location which can be uniquely addressed —Word internally

Access Methods (2)

  • (^) Random —Individual addresses identify locations exactly —Access time is independent of location or previous access —e.g. RAM
  • (^) Associative —Data is located by a comparison with contents of a portion of the store —Access time is independent of location or previous access —e.g. cache

Memory Hierarchy

  • (^) Registers —In CPU
  • (^) Internal or Main memory —May include one or more levels of cache —“RAM”
  • (^) External memory —Backing store

Performance

  • (^) Access time —Time between presenting the address and getting the valid data
  • (^) Memory Cycle time —Time may be required for the memory to “recover” before next access —Cycle time is access + recovery
  • (^) Transfer Rate —Rate at which data can be moved

Hierarchy List

  • (^) Registers
  • (^) L1 Cache
  • (^) L2 Cache
  • (^) Main memory
  • (^) Disk

Cache

  • (^) Small amount of fast memory
  • (^) Sits between normal main memory and CPU
  • (^) May be located on CPU chip or module

Cache and Main Memory

Cache operation – overview

  • (^) CPU requests contents of memory location
  • (^) Check cache for this data
  • (^) If present, get from cache (fast)
  • (^) If not present, read required block from main memory to cache
  • (^) Then deliver from cache to CPU
  • (^) Cache includes tags to identify which block of main memory is in each cache slot

Cache Read Operation - Flowchart

Cache Addressing

  • (^) Where does cache sit? — (^) Between processor and virtual memory management unit — (^) Between MMU and main memory
  • (^) Logical cache (virtual cache) stores data using virtual addresses — (^) Processor accesses cache directly, not thorough physical cache — (^) Cache access faster, before MMU address translation — (^) Virtual addresses use same address space for different applications - (^) Must flush cache on each context switch
  • (^) Physical cache stores data using main memory physical addresses

Size does matter

  • (^) Cost —More cache is expensive
  • (^) Speed —More cache is faster (up to a point) —Checking cache for data takes time