11 Cache Memory, Internal, External
11 Cache Memory, Internal, External
11 Memory
Tim Dosen
Reference
Computer Organization And
Architecture 10th Global Edition,
William Stallings, Pearson
Education
Characteristics of Memory
Characteristics
1. Location
2. Capacity
3. Unit of transfer
4. Access method
5. Performance
6. Physical type
7. Physical characteristics
8. Organisation
1/8 Location
• Internal
• Register
• Cache
• Main Memory
• External
• Storage
2/8 Capacity
• Typically expressed in terms of bytes (1 byte = 8 bits) or words
• Word size
• The natural unit of organisation
• Number of words
• or Bytes
3/8 Unit of Transfer
Unit of transfer is equal to the number of electrical lines into and out of
the memory module.
• Internal
• Usually governed by data bus width
• External
• Usually, a block which is much larger than a word
4/8 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
4/8 Access Methods (2)
• 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
4/8 Access Methods (3)
• 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
5/8 Memory Hierarchy
• Registers
• In CPU
• Main memory
• May include one or more
levels of cache
• “RAM”
• External memory
• Backing store
6/8 Performance
• Access time
• Time between presenting the address and getting the valid data
• Transfer Rate
• Rate at which data can be moved
7/8 Physical Types
• Semiconductor
• RAM
• Magnetic
• Disk & Tape
• Optical
• CD & DVD
• Others
• Bubble
• Hologram
8/8 Physical Characteristics
• Volatility
• Volatile: data decays naturally or is lost when electrical power is switched off
• Non-Volatile: data once recorded remains without deterioration until
deliberately changed (Magnetic-surface memories)
• Erasable
• Non-erasable: data cannot be altered, except by destroying the storage unit
(ROM)
• Power consumption
Cache Memory Principle
Cache Memory
• Cache memory is designed to combine the memory access time of
expensive, highspeed memory combined with the large memory size
of less expensive, lower-speed memory.
• Speed
• More cache is faster (up to a point)
• Checking cache for data takes time
Comparison
of Cache
Sizes
Cache Mapping Function
Mapping Function
• 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)
1/3 Direct Mapping
1/3 Direct Mapping
• A particular block of main
memory can map only to a
particular line of the cache.
• Downside:
• Lots of traffic
• Slows down writes
2/2 Write back
• Updates initially made in cache only
• Update bit for cache slot is set when update occurs
• If block is to be replaced, write to main memory only if update bit is
set
• Downside:
• Other caches get out of sync
• I/O must access main memory through cache
• N.B. 15% of memory references are writes
More reading
• How Memory Is Accessed (intel.com)
• AMD Infinity Cache Explained : L3 Cache Comes To The GPU! | Tech
ARP
Internal Memory Types
Semiconductor Memory Types
• Enhanced DRAM
• Contains small SRAM as well
• SRAM holds last line read (Cache)
• Cache DRAM
• Larger SRAM component
• Use as cache or serial buffer
Synchronous DRAM (SDRAM)
• Access is synchronized with an external clock
• Address is presented to RAM
• RAM finds data (CPU waits in conventional DRAM)
• Since SDRAM moves data in time with system clock, CPU knows when data will be
ready
• CPU does not have to wait, it can do something else
• Burst mode allows SDRAM to set up stream of data and fire it out in block
• DDR-SDRAM sends data twice per clock cycle (leading & trailing edge)
RAMBUS
• Adopted by Intel for Pentium & Itanium
• Main competitor to SDRAM
• Vertical package – all pins on one side
• Bus addresses up to 320 RDRAM chips at 1.6Gbps
• Asynchronous block protocol
• 480ns access time
• Then 1.6 Gbps
RAMBUS Diagram
DDR SDRAM
• SDRAM can only send data once per clock
• Double-data-rate SDRAM can send data twice per clock cycle
• Rising edge and falling edge
Magnetic Disk
External Memory
Magnetic Disk
• Disk substrate coated with
magnetizable material (iron oxide…rust)
• Substrate used to be aluminium
• Now glass
• Improved surface uniformity
• Increases reliability
• Reduction in surface defects
• Reduced read/write errors
• Lower flight heights (See later)
• Better stiffness
• Better shock/damage resistance
Read and Write Mechanisms
• Recording & retrieval via conductive coil called a
head
• May be single read/write head or separate ones
• During read/write, head is stationary, platter rotates
• Write
• Current through coil produces magnetic field
• Pulses sent to head
• Magnetic pattern recorded on surface below
• Read (traditional)
• Magnetic field moving relative to coil produces
current
• Coil is the same for read and write
• Read (contemporary)
• Separate read head, close to write head
• Partially shielded magneto resistive (MR) sensor
• Electrical resistance depends on direction of magnetic
field
• High frequency operation
• Higher storage density and speed
Data Organization and
Formatting
• Concentric rings or tracks
• Gaps between tracks
• Reduce gap to increase capacity
• Same number of bits per track (variable
packing density)
• Constant angular velocity
• Tracks divided into sectors
• Minimum block size is one sector
• May have more than one sector per block
Disk Velocity
• Bit near centre of rotating disk passes fixed point slower
than bit on outside of disk
• Increase spacing between bits in different tracks
• Rotate disk at constant angular velocity (CAV)
• Gives pie shaped sectors and concentric tracks
• Individual tracks and sectors addressable
• Move head to given track and wait for given sector
• Waste of space on outer tracks
• Lower data density
• Can use zones to increase capacity
• Each zone has fixed bits per track
• More complex circuitry
Comparison of Disk Layout Methods
Finding Sectors
• Must be able to identify start of track and sector
• Format disk
• Additional information not available to user
• Marks tracks and sectors
Winchester Disk Format
Seagate ST506
Hard Disk Comparison
Speed
• Seek time
• Moving head to correct track
• (Rotational) latency
• Waiting for data to rotate under head
• Access time = Seek + Latency
• Transfer rate
Timing of Disk I/O Transfer
Solid State Drive
External Memory
Architecture
• Controller: Provides SSD device
level interfacing and firmware
execution.
Difference:
• Wiring method
• Cells in NOR are wired in parallel
• Cells in NAND are wired in series
• Wiring requirement
• NOR uses more wiring, cannot be packed together like NAND
• NAND uses less wiring, can be packed more tightly
• Because of these wiring method
• NOR ideal for lower-density, high-speed, read-only application
• NAND is less expensive, can read/write much faster
NOR NAND
SSD Solid State Drive
• Solid State Drive is a device that uses
NAND flash to provide non-volatile
rewritable memory.
(Oxide-Nitrite-Oxide)
Types of Cells in NAND Flash
• Single-level cell (SLC) NAND
• Store one bit, 1 or 0
• Faster to read/write, wears longer
Data
Mapping