CACHE
Pronounced cash, a special high-speed storage mechanism. Cache can be either a reserved section of main memory or an independent high-speed storage device. Two types of caching are commonly used in personal computers: memory caching and disk caching.
Elements of cache addresing:
- cache address
- mapping function
- replacement algorithm
- write policy
location of memory:
- internal & external in computer
Internal:
cache is internal form memory,
• External :
Storage devices (paper tape, cards, tapes, discs, flash cards, etc.)
Capacity
• Word size
The natural unit of organisation and Typically number of bits used to represent an
integer in the processor
• Number of words
Most memory sizes are now expressed in bytes . Most modern processors have byte-addressable
memory but some have word addressable memory .Memory capacity for A address lines is 2A
addressable units
Unit of Transfer
• Internal :Usually governed by data bus width
• External :Usually a block which is much larger than a word
(typical disk 512 - 4096 bytes)
• Addressable unit :Smallest location which can be uniquely addressed .Some systems have only word addressable memory
while many have byte addressable memory .A block or even cluster of blocks on most disks
Acces method
• 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
• 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. All memory is checked simultaneously; access time
is constant
— e.g. cache
• Three performance parameters:
— Access time
— Cycle Time
— Transfer Rate
Physical type:
• Semiconductor — RAM (volatile or non-volatile)
• Magnetic Surface Memory — Disk & Tape
• Optical
— CD & DVD
• Others
— Magneto-optical
— Bubble
— Hologram
Character
• Volatility: Does the memory retain data in the absence of electrical power?
• Decay: Ranges from tiny fractions of a second (volatile
DRAM) to many years (CDs, DVDs)
• Erasable:Can the memory be rewritten? If so, how fast? How
many erase cycles can occur?
• Power consumption
Organization
• Physical arrangement of bits into words
• Not always obvious, e.g., interleaved memory
(examples later)
Memory Hierarchy
• For any memory: How fast? How much? How expensive?
• Faster memory => greater cost per bit
• Greater capacity => smaller cost / bit
• Greater capacity => slower access
• Going down the hierarchy: Decreasing cost / bit [Increasing capacity ] Increasing access time .Decreasing frequency of access by processor
Cache memory Principals
• Locality of reference makes it likely that other words in the same block will be accessed soon
Types of memory
)Real memory
= Main memory
)Virtual memory:
=memory on disk
Memory Hierarchy
• Registers
— In CPU
• Internal or Main memory
— May include one or more levels of cache (“RAM”)
• External memory
— Backing store
Mapping Function
• There are fewer cache lines than memory
blocks so we need , An algorithm for mapping memory into cache lines. A means to determine which memory block is in
which cache line
• Example elements:
— Cache of 64kByte /Cache block of 4 bytes
– i.e. cache is 16k (214) lines of 4 bytes/16MBytes main memory/ 24 bit address (224=16M.
No comments:
Post a Comment