William Stallings Computer Organization and Architecture 7th Edition Cache Memory
William Stallings Computer Organization and Architecture 7th Edition Cache Memory
Computer Organization
and Architecture
7th Edition
Chapter 4
Cache Memory
Characteristics
• Location
• Capacity
• Adressable units (2A=N) (A:Adr.Line bits)
• Unit of transfer
• Access method
• Performance
• Physical type
• Physical characteristics
• Organisation
Location
• CPU
• Internal (main)
• External (secondary)
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 (1)
• Sequential
—Start at the beginning and read through in
order
—Access time depends on location of data and
previous location
—e.g. tape
• Direct
—Individual blocks have unique address
—Access is by jumping to vicinity plus
sequential search
—Access time depends on location and previous
location
—e.g. disk
Access Methods (2)
• Random
—Individual addresses identify locations exactly
—Access time is independent of location or
previous access
—e.g. RAM
• Associative
—Random in nature. 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
Performance
• Access time
—Time between presenting the address and
getting the valid data (Random type), time to
position read-write mechanism (non random)
• 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 (for random
access =1/cycle time)
For non random access memory:
TN = TA + N/R
TN : Average time to read or write N bits
TA : Average access time
N : Number of bits
R : Transfer rate in bps
The Bottom Line
• How much?
—Capacity (open ended)
• How fast?
—Time is money (keep up with the processor)
• How expensive?
—Reasonably priced in comparison to other
components
•Decraesing frequency of
access by the processor
•Increasing access time
•Decraesing cost/bit
•Increasing capacity
T1+T2
T1
s
Set Associative Mapping
Example
• 13 bit set number
• Block number in main memory is modulo
213
• 000000, 008000, ..., FF8000 map to same
set
Two Way Set Associative Cache
Organization
Set Associative Mapping
Address Structure
Word
Tag 9 bit Set 13 bit 2 bit
External memory slower than the system bus. Add external cache using faster 386
memory technology.
Increased processor speed results in external bus becoming a Move external cache on-chip, 486
bottleneck for cache access. operating at the same speed as the
processor.
Internal cache is rather small, due to limited space on chip Add external L2 cache using faster 486
technology than main memory