210 likes | 642 Vues
Cache Memory. By Aung Oo. Cache. Memory Cache Hard drive Cache Printer Cache CD-Rom Cache Browser Cache. What is Cache in general?. A cache is meant to improve access times and enhance the overall performance of your computer.
E N D
Cache Memory By Aung Oo
Cache • Memory Cache • Hard drive Cache • Printer Cache • CD-Rom Cache • Browser Cache
What is Cache in general? • A cache is meant to improve access times and enhance the overall performance of your computer. • e.g. browser cache stores the most recent websites you've visited. If the site hasn't changed, it can load it quicker from your hard drive than it can over slow internet connection.
Cache Memory • Cache RAM is extremely fast--it is capable of delivering data at the speed of the CPU. • The CPU is faster than the rest of the system and needs a place to store information that can be accessed fast.
Cache Memory Cont. • The cache memory minimizes the number of outgoing transactions from the CPU. • Having that cache memory read in and write to main memory in "spare" time, the processor can operate at full speed much of the time.
Cache Level When we talk about the level of cache we're referring to it's connecting circuits or electronic pathways (bus) and physical proximity to the CPU.
Internal Cache (Level I or L1) • L1 cache is a small amount of SRAM that is placed inside the actual CPU (internally) allows a buffer for the rest of the system to keep up with it. • It runs at the same speed as the processor.
External Cache (Level II or L2) • Typically L2 Cache is separate (or external) from the CPU . It's often socketed on the motherboard in DIP chips or in COAST slots. • L2 cache acts more for information heading out of the CPU rather than in it. • It runs at the speed of the motherboard or FSB.
External Cache? • To shorten the bus length and increase the speed to L2 cache, modern computers have the L2 cache inside the CPU chip or CPU cartridge • It's still separate from the CPU core and connected by a bridge or what is termed the “backside bus”. • It runs at half the processor speed .
External Cache (Level III or L3) • L3 cache attached to the motherboard. • With a bus speed the same as the (FSB) system bus. • Found mostly in Intel Xeon Workstation and also in Pentium 4 EE (Extreme Edition).
Why is Cache memory expensive? • The cache is made up of extremely fast silicon memory, and is called SRAM (Static RAM) which runs as fast as CPU. • It takes up a lot more space. You wouldn't have enough room on your motherboard for even 16MB of SRAM (and the cost would make home computer unaffordable for most people.)
Types Of Cache • Asynchronous SRAM The RAM is called asynchronous because the processor has provide a address for each cache access then in turn has to wait. (This is a older type cache and is found on 386 and 486 machines.) • Synchronous Burst SRAM It allows for the RAM to work in step with the system clock. It also free ups the problems with the CPU. In other words less waiting. • Pipeline Burst SRAM This type is much like the Synchronous and is far cheaper. Found on current Pentium systems.
How does Cache Memory works? The details of how cache memory works vary depending on the different cache controllers and processors. • The most recently accessed information or instructions can help the controller to guess at what RAM locations may be accessed next and these are stored in the cache.
Write Hit • When the CPU needs its next instruction or piece of data, it looks in the cache. • If the info is there, it's called a “cache hit” or “write hit” and is retrieved at a faster speed than it would be from system memory. • Write-through policy – both cache and memory updated • Write-back policy – cache is updated and memory updated after a new block is loaded into cache
Write Miss • If next intrustion isn't in the cache, then it's called a “cache miss” or “write miss” and the information is retrieved from system memory (slower DRAM). • Write-allocate policy– updated block of memory is selected into cache. • Write-no-allocate policy– only update memory, cache is not updated
Hit Ratio • The hit ratio–hits divided by the sum of hits and misses–is a measure of cache performance. • A well-designed cache can have a hit ratio close to 1. • The number of cache hits, far outnumber the misses and this speeds up system performance dramatically.
References • http://www.pccomputernotes.com/cache/cache01.htm • http://www.waterwheel.com/Guides/memory/memory_cache.htm • http://www.newton.dep.anl.gov/askasci/comp99/CS017.htm • http://www.newton.dep.anl.gov/askasci/comp99/CS035.htm • “Assembly Language and Computer Architecture Using C++ and Java” by Anthony J. Dos Reis, section 14.8