Download presentation
Presentation is loading. Please wait.
Published byMildred Bailey Modified over 9 years ago
1
What is cache memory?
2
Cache Cache is faster type of memory than is found in main memory. In other words, it takes less time to access something in cache than in main memory. It ‘sits’ between external memory (main memory) and the processor. Runs at the speeds close to that of the of the processor and has two main types.
3
L1 which stores instructions going to the processor. Often split into two L1cache for instructions and L1 cache for data. L2 which is used buffer data between L1 cache and main memory, sometimes called unified cache.
4
Principle of locality The nature of programs and structure of data often means that requests to memory are not random, but localised. Programs tend to reuse data and instructions that have been recently used – temporal locality. Instructions and data referenced closed together in time, or often close together physically in memory- spatial locality.
5
When data is transferred between main memory and the processor, a copy of the data is saved to cache. When the processor needs more data, the addresses are checked to see if the data is already in the cache, if it there is no need to transfer the data from main memory which is slower. This is a cache hit and the data is taken directly from the cache. If the data is not, in the cache, this is known as a cache miss and a memory transfer is performed.
6
The ability to store more data in a cache will makes the computer faster, so bigger caches are an advantage. However, cost is a limiting factor as this type of memory is more expensive than main memory.
7
Comparison of speeds for cache and main memory Processor CPU (MHz)L1(ns)L2(ns) main memory(ns) 486 100103060 Pentium 23341560 Pentium II 4502460 Pentium III 5502410 Pentium 4 20000.50.51.2 Data taken from Dick D (2002) The P.C. Support Handbook page 120.
8
Harvard Architecture Instruction and data memories occupy different address spaces. That is, there is an address 'zero' in instruction space that refers to an instruction storage location and also an address 'zero' in data space that refers to a distinct data storage location. Instruction and data memories have separate hardware pathways to the central processing unit (CPU).
9
Summary There is hierarchy of memory. The higher level in the hierarchy a device the more expensive, less that can be stored, but it is but the quicker to access. Cache, a form of RAM, ‘sits’ between external memory (main memory) and the processor. Runs at the speed of the processor and has two main types. – L1 which stores instructions going to the processor. – L2 which is used buffer data from memory.
10
Harvard architecture – Instruction and data memories occupy different address spaces. – Instruction and data memories have separate hardware pathways to the central processing unit (CPU).
11
Sources for further reading Chalk et al (2004) Chapter 6 pages 101-107 Dick D (2002) The P.C. Support Handbook page 120.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.