Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Memory

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

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.

Memory can be either volatile or non-volatile memory.


3 Types of Memory

● 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

● Cache memory is faster than main memory.


● It consumes less access time as compared to main memory.
● It stores the program that can be executed within a short period of time.
● It stores data for temporary use.
Disadvantages of Cache Memory

● Cache memory has limited capacity.


● It is very expensive.
How does cache work?

In order to understand the working of cache we must understand few points:

● Cache memory is faster, they can be accessed very fast


● Cache memory is smaller, a large amount of data cannot be stored

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

● On searching in the cache if data is found, a cache hit has occurred.


● On searching in the cache if data is not found, a cache miss has occurred.

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.

Hit ratio=(Number of cache hits)/(Number of searches)


Types of Cache Memory

● 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 cache is smaller in size. ● RAM is larger in size compared to


Memory ranges from 2KB to a cache. Memory ranges from 1MB to
few MB generally.
● It holds frequently accessed 128GB
data. ● It stores data that is currently
● OS interacts with primary processed by the processor.
memory to get data to be
● OS interacts with secondary memory
stored in Cache.
● CPU searches for data in to get data to be stored in Primary
Cache. If not found, cache Memory or RAM
miss occur. ● It is ensured that data in RAM are
loaded before access to the CPU.
This eliminates RAM miss never.
Primary Memory/Main
Memory
What is Primary Memory?

Primary memory is also known as main memory or may also refer to


“Internal memory.” and primary storage. All those types of computer
memories that are directly accessed by the processor using data bus
are called primary memory. That allows a processor to access stores
running programs and currently processed data that stored in a
memory location.
Types of Primary Memory
1. RAM (Random Access Memory)
2. ROM (Read Only Memory)
RAM (Random Access Memory)

The Word “RAM” stands for “random access memory” or may


also refer to short-term memory. It’s called “random” because
you can read store data randomly at any time and from any
physical location. It is a temporal storage memory. RAM is
volatile that only retains all the data as long as the computer
powered. It is the fastest type of memory. RAM stores the
currently processed data from the CPU and sends them to the
graphics unit.
RAM (Random Access Memory)

RAM is volatile, i.e. data stored in it is lost when we switch off


the computer or if there is a power failure. Hence, a backup
Uninterruptible Power System (UPS) is often used with
computers. RAM is small, both in terms of its physical size and
in the amount of data it can hold.
Static RAM (SRAM)

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. Short data lifetime


2. Needs to be refreshed continuously
3. Slower as compared to SRAM
4. Used as RAM
5. Smaller in size
6. Less expensive
7. Less power consumption
ROM (Read Only Memory)

ROM is the long-term internal memory. ROM is “Non-Volatile Memory”


that retains data without the flow of electricity. ROM is an essential chip
with permanently written data or programs. It is similar to the RAM that is
accessed by the CPU. ROM comes with pre-written by the computer
manufacturer to hold the instructions for booting-up the computer.
The memory from which we can only read but cannot write on it. ROM
stores such instructions that are required to start a computer. This
operation is referred to as bootstrap. ROM chips are not only used in the
computer but also in other electronic items like washing machine and
microwave oven.
Advantages of ROM(Read-only Memory)

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

1. PROM(Programmable Read Only Memory)


2. EPROM (Erasable Programmable Read Only Memory)
3. EEPROM (Electrically Erasable Programmable Read Only Memory)
PROM(Programmable Read Only Memory)

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

EEPROM is programmed and erased electrically. It can be erased and reprogrammed


about ten thousand times. Both erasing and programming take about 4 to 10 ms
(millisecond). In EEPROM, any location can be selectively erased and programmed.
EEPROMs can be erased one byte at a time, rather than erasing the entire chip.
Hence, the process of reprogramming is flexible but slow.

You might also like