Computer Memory
Computer Memory
Computer Memory
Memory
A memory is just like a human brain. It is used to store data and instructions. Computer memory is the
storage space in the computer, where data is to be processed and instructions required for processing are
stored.The memory is divided into large number of small parts called cells. Each location or cell has a
unique address, which varies from zero to memory size minus one.For example, if the computer has 64k
words, then this memory unit has 64 * 1024 = 65536 memory locations.
Computer memory is any physical device capable of storing information temporarily, , or permanently.
Memory devices utilize integrated circuits and are used by operating systems, software, and hardware.
● Cache Memory
● Primary Memory/Main Memory
● Secondary Memory
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU. It acts as a
buffer between the CPU and the main memory. It is used to hold those parts of data and program which
are most frequently used by the CPU. The parts of data and programs are transferred from the disk to
cache memory by the operating system, from where the CPU can access them.
In a hierarchy of memory, cache memory has access time lesser than primary memory. Generally, cache
memory is very smaller and hence is used as a buffer.
Buffer is a region of memory used to temporarily hold data while it is being moved from one place to
another. A buffer is used when moving data between processes within a computer.
Advantages of Cache Memory
Whenever CPU needs any data it searches for corresponding data in the cache (fast process) if data is
found, it processes the data according to instructions, however, if data is not found in the cache CPU
search for that data in primary memory(slower process) and loads it into the cache. This ensures
frequently accessed data are always found in the cache and hence minimizes the time required to access
the data.
Cache performance
Performance of cache is measured by the number of cache hits to the number of searches. This
parameter of measuring performance is known as the Hit Ratio.
● L1 or Level 1 Cache: It is the first level of cache memory that is present inside the processor. It is present in
a small amount inside every core of the processor separately. The size of this memory ranges from 2KB to
64 KB.
● L2 or Level 2 Cache: It is the second level of cache memory that may present inside or outside the CPU. If
not present inside the core, It can be shared between two cores depending upon the architecture and is
connected to a processor with the high-speed bus. The size of memory ranges from 256 KB to 512 KB.
● L3 or Level 3 Cache: It is the third level of cache memory that is present outside the CPU and is shared by
all the cores of the CPU. Some high processors may have this cache. This cache is used to increase the
performance of the L2 and L1 cache. The size of this memory ranges from 1 MB to 8MB.
Cache vs RAM
Although Cache and RAM both are used to increase the performance of the system there exists a lot of
differences in which they operate to increase the efficiency of the system.
Cache vs RAM
The word static indicates that the memory retains its contents as long as power is
being supplied. However, data is lost when the power gets down due to volatile
nature. SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do
not require power to prevent leakage, so SRAM need not be refreshed on a regular
basis.
There is extra space in the matrix, hence SRAM uses more chips than DRAM for the
same amount of storage space, making the manufacturing costs higher. SRAM is thus
used as cache memory and has very fast access.
Characteristics of SRAM
1. Long life
2. No need to refresh
3. Faster
4. Used as cache memory
5. Large size
6. Expensive
7. High power consumption
Dynamic RAM (DRAM)
DRAM, unlike SRAM, must be continually refreshed in order to maintain the data.
This is done by placing the memory on a refresh circuit that rewrites the data several
hundred times per second. DRAM is used for most system memory as it is cheap and
small. All DRAMs are made up of memory cells, which are composed of one capacitor
and one transistor.
Characteristics of Dynamic RAM
1. Non-volatile in nature
2. Cannot be accidentally changed
3. Cheaper than RAMs
4. Easy to test
5. More reliable than RAMs
6. Static and do not require refreshing
7. Contents are always known and can be verified
Three broad types of ROM
It can be programmed only be done once and read many. Unlike RAM, PROMs retain
their contents without the flow of electricity. PROM is also nonvolatile memory. The
significant difference between a ROM and a PROM is that a ROM comes with
pre-written by the computer manufacturer whereas PROM manufactured as blank
memory. PROM can be programmed by PROM burner and by blowing internal fuses
permanently.
EPROM (Erasable Programmable Read Only Memory)
EPROM can be erased by exposing it to ultra-violet light for a duration of up to 40
minutes. Usually, an EPROM eraser achieves this function. During programming, an
electrical charge is trapped in an insulated gate region. The charge is retained for
more than 10 years because the charge has no leakage path. For erasing this charge,
ultra-violet light is passed through a quartz crystal window (lid). This exposure to
ultra-violet light dissipates the charge. During normal use, the quartz lid is sealed
with a sticker.
EEPROM (Electrically Erasable Programmable Read
Only Memory