Cache memory: Difference between revisions

From Computer Science Wiki
(Created page with "frame|right|This is a basic concept in computer science The primary memory stores the program instructions and the data in binary machine code. The Contro...")
 
No edit summary
Line 1: Line 1:
[[File:binary.png|frame|right|This is a basic concept in computer science]]
[[File:binary.png|frame|right|This is a basic concept in computer science]]


The primary memory stores the program instructions and the data in binary machine code. The Control Unit deals with the instructions and the Arithmetic and Logic unit handles calculations and comparisons with the data. Data and instructions are moved by buses.
Cache is very fast and small memory that is placed in between the CPU and the main memory.
 
Cache memory is used to reduce the average memory access times. This is done by storing the data that is frequently accessed in main memory addresses therefore allowing the CPU to access the data faster. This is due to the fact that cache memory can be read a lot faster than main memory. There are different types of cache (e.g. L1,L2 and L3)<ref>https://compsci2014.wikispaces.com/2.1.3+Explain+the+use+of+cache+memory</ref>
There are two types of memory in primary memory (also known as the Immediate Access Store ) of the computer, RAM and ROM<ref>http://www.ib-computing.net/program/core/memories.html</ref> :
 
* RAM is Random Access Memory which loses its contents when the computer is switched off (it is volatile ). This memory can be written to, instructions and data can be loaded into it.
 
* ROM , or Read Only Memory is non-volatile and is used to store programs permanently (the start-up or " boot " instructions, for example), the computer cannot store anything in this type of memory.
 
When the programs and data files (known as the software ) are not in RAM, they are stored on [[secondary memory]] (also known as backing store ) such as tapes or discs. The tape or disc drives and any input and output devices connected to the CPU are known collectively as peripherals.
 
'''RAM – Random Access Memory'''<ref>http://dis-dpcs.wikispaces.com/2.1.2+Primary+Memory+and+2.1.3+Cache+Memory</ref>
* The RAM is where programs, instructions, values are stored at runtime
* The RAM can be accessed a lot faster than the hard disk
* All information is lost when the power is turned off
* Allows storage and random access of the data
* Each program instruction & piece of data in the RAM has a unique address
 
'''ROM – Read Only Memory'''
* Can not be written to easily or at all (often times once only, then never again)
* In modern PCs usually used for firmware in CPU, Graphics card, hard disks, etc.
* Many ROM modules are replaced with Flash modules nowadays (ex. BIOS, firmware modules) to allow easier updating
* In devices like keyboards, etc. which aren’t designed for firmware updates ROM might still be used
* Stores code for interrupter
 
 
'''Virtual memory'''
To expand memory usable by the CPU it is possible to use something called virtual memory where the most important instructions for the program are stored in the RAM and the less necessary information is stored in secondary memory (usually the HDD) and then the data is switched between RAM and virtual memory as it is needed (to swap).
 
Advantages:
* More memory to work with.
 
Disadvantages:
* It is very slow compared to the primary memory
* Thrashing can occur. Thrashing is a condition when there is too much data that needs to be swapped between RAM and virtual memory, and the computer's response time is compromised.
 
 


== Do you understand this topic? ==  
== Do you understand this topic? ==  

Revision as of 11:05, 25 August 2016

This is a basic concept in computer science

Cache is very fast and small memory that is placed in between the CPU and the main memory. Cache memory is used to reduce the average memory access times. This is done by storing the data that is frequently accessed in main memory addresses therefore allowing the CPU to access the data faster. This is due to the fact that cache memory can be read a lot faster than main memory. There are different types of cache (e.g. L1,L2 and L3)[1]

Do you understand this topic?[edit]

  • Describe primary memory.

Do you have an advanced understanding about this topic?[edit]

  • Explain why investing in primary memory may provide better performance than secondary memory.

References[edit]