0% found this document useful (0 votes)
8 views

AIML NOTES UNIT-4

The document discusses various aspects of memory organization in computers, including main and auxiliary memory, memory hierarchy, associative memory, virtual memory, and cache memory. It highlights the differences between primary and secondary memory, the significance of memory hierarchy in improving access time and performance, and the role of associative memory in efficient data retrieval. Additionally, it explains concepts like locality of reference, cache performance, and memory interleaving principles.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

AIML NOTES UNIT-4

The document discusses various aspects of memory organization in computers, including main and auxiliary memory, memory hierarchy, associative memory, virtual memory, and cache memory. It highlights the differences between primary and secondary memory, the significance of memory hierarchy in improving access time and performance, and the role of associative memory in efficient data retrieval. Additionally, it explains concepts like locality of reference, cache performance, and memory interleaving principles.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

UNIT -4 MEMORY ORGANIZATION

MAIN AND AUXILIARY MEMORY[TOPIC-1]


Main memory: is used to store data and instructions while a program is running,
Auxiliary memory :is used to store data and programs that aren't currently in use

Primary memory Secondary memory

The primary memory of a computer is the Secondary memory defines to additional


main memory that is utilized to store data storage devices that are utilized to store
temporarily. data permanently.

Primary memory is temporary. Secondary memory is permanent.

Primary memory is faster than secondary Secondary memory is non-volatile, which


memory because it is directly accessible to means it retains data even when the power
Primary memory Secondary memory

the CPU. is off.

Primary memory is directly accessible by Secondary memory is not directly accessible


Processor/CPU. by the CPU.

Nature of Parts of Primary memory varies,


It’s always Non-volatile in nature.
RAM- volatile in nature. ROM- Non-volatile.

Primary memory is volatile, which means it


Since it is non-volatile, data can be retained
is wiped out when the computer is turned
in case of a power failure.
off.

Secondary memory devices are less


Primary memory devices are more expensive
expensive when compared to primary
than secondary storage devices.
memory devices.
Primary memory Secondary memory

The memory devices used for primary The secondary memory devices are
memory are semiconductor memories. magnetic and optical memories.

It can hold data/information currently being It can hold data/information that are not
used by the processing unit. currently being used by the processing unit.

It stores a considerable amount of data and


The capacity of primary memory is usually information. The capacity of secondary
within the range of 16 to 32 GB. memory ranges from 200 GB to some
terabytes.

Primary memory is also known as Main Secondary memory is also known as


memory or Internal memory. External memory or Auxiliary memory.

It can be accessed by a data bus. It can be accessed using I/O channels.


Primary memory Secondary memory

Examples: RAM, ROM, Cache memory, Examples: Hard Disk, Floppy Disk, Magnetic
PROM, EPROM, Registers, etc. Tapes, etc.

MEMORY HIERACRCHY IN COMPUTER[TOPIC-2]

Memory Hierarchy, in Computer System Design, is an enhancement that helps in organising


the memory so that it can actually minimise the access time.
The development of the Memory Hierarchy occurred on a behaviour of a program known as
locality of references. Here is a figure that demonstrates the various levels of memory
hierarchy clearly:
Memory Hierarchy Design
This Hierarchy Design of Memory is divided into two main types. They are:
External or Secondary Memory
It consists of Magnetic Tape, Optical Disk, Magnetic Disk, i.e. it includes peripheral storage
devices that are accessible by the system’s processor via I/O Module.
Internal Memory or Primary Memory
It consists of CPU registers, Cache Memory, and Main Memory. It is accessible directly by the
processor.
Design of Memory Hierarchy
In computers, the memory hierarchy primarily includes the following:
1. Registers
The register is usually an SRAM or static RAM in the computer processor that is used to hold
the data word that is typically 64 bits or 128 bits. A majority of the processors make use of a
status word register and an accumulator. The accumulator is primarily used to store the data
in the form of mathematical operations, and the status word register is primarily used for
decision making.
2. Cache Memory
The cache basically holds a chunk of information that is used frequently from the main
memory. We can also find cache memory in the processor. In case the processor has a single-
core, it will rarely have multiple cache levels. The present multi-core processors would have
three 2-levels for every individual core, and one of the levels is shared.
3. Main Memory
In a computer, the main memory is nothing but the CPU’s memory unit that communicates
directly. It’s the primary storage unit of a computer system. The main memory is very fast and
a very large memory that is used for storing the information throughout the computer’s
operations. This type of memory is made up of ROM as well as RAM.
4. Magnetic Disks
In a computer, the magnetic disks are circular plates that’s fabricated with plastic or metal
with a magnetised material. Two faces of a disk are frequently used, and many disks can be
stacked on a single spindle by read/write heads that are obtainable on every plane. The disks
in a computer jointly turn at high speed.
5. Magnetic Tape
Magnetic tape refers to a normal magnetic recording designed with a slender magnetizable
overlay that covers an extended, thin strip of plastic film. It is used mainly to back up huge
chunks of data. When a computer needs to access a strip, it will first mount it to access the
information. Once the information is allowed, it will then be unmounted. The actual access
time of a computer memory would be slower within a magnetic strip, and it will take a few
minutes for us to access a strip.

SIGINIFICANCE OF MEMORY DEVICES[TOPIC-3]


One can infer these characteristics of a Memory Hierarchy Design from the figure given
above:
1. Capacity
It refers to the total volume of data that a system’s memory can store. The capacity increases
moving from the top to the bottom in the Memory Hierarchy.
2. Access Time
It refers to the time interval present between the request for read/write and the data
availability. The access time increases as we move from the top to the bottom in the Memory
Hierarchy.
3. Performance
When a computer system was designed earlier without the Memory Hierarchy Design, the
gap in speed increased between the given CPU registers and the Main Memory due to a large
difference in the system’s access time.It ultimately resulted in the system’s lower
performance, and thus, enhancement was required. Such a kind of enhancement was
introduced in the form of Memory Hierarchy Design, and because of this, the system’s
performance increased. One of the primary ways to increase the performance of a system is
minimising how much a memory hierarchy has to be done to manipulate data.
4. Cost per bit
The cost per bit increases as one moves from the bottom to the top in the Memory Hierarchy,
i.e. External Memory is cheaper than Internal Memory.
5.ALTERABILITY
Alterability is the ability to change or modify something. In computer organization,
alterability refers to the ability to modify data or programs on a storage device
6.CYCLE TIME
A clock cycle is the basic unit of time in a computer's central processing unit (CPU). It's also
known as a machine cycle or a clock tick.

ASSOSCIATE MEMORY[TOPIC-4]
Associative memory is designed to quickly find matching data, even when the search query is
incomplete or imprecise. This is achieved by using parallel processing techniques, where
multiple search queries can be performed simultaneously.
The search is also performed in a single step, as opposed to conventional memory where
multiple steps are required to locate the data.
Hardware organization of associative memory:-
Block Diagram of associative memory
 Argument Register: It contains words to be searched. It contains ‘n’ number of bits.
 Match Register: It has m-bits, One bit corresponding to each word in the memory array.
After the making process, the bits corresponding to matching words in match register
are set to ‘1’.
 Key Register: It provides a mask of choosing a particular field/key in argument register. It
specifies which part of the argument word need to be compared with words in memory.
 Associative Memory Array: It combines word in that are to be compared with the
arguments word in parallel. It contains ‘m’ words with ‘n’ bit per word.
Applications of Associative memory :-
1. It can be only used in memory allocation format.
2. It is widely used in the database management systems, etc.
3. Networking: Associative memory is used in network routing tables to quickly find the
path to a destination network based on its address.
4. Image processing: Associative memory is used in image processing applications to search
for specific features or patterns within an image.
5. Artificial intelligence: Associative memory is used in artificial intelligence applications
such as expert systems and pattern recognition.
6. Database management: Associative memory can be used in database management
systems to quickly retrieve data based on its content.
Advantages of Associative memory :-
1. It is used where search time needs to be less or short.
2. It is suitable for parallel searches.
3. It is often used to speedup databases.
4. It is used in page tables used by the virtual memory and used in neural networks.
Disadvantages of Associative memory :-
1. It is more expensive than RAM
1. Each cell must have storage capability and logical circuits for matching its content with
external argument.

VIRTUAL MEMORY ORGANIZATION[TOPIC-5]


Virtual memory is the partition of logical memory from physical memory. This partition
supports large virtual memory for programmers when only limited physical memory is
available.
Virtual memory can give programmers the deception that they have a very high memory
although the computer has a small main memory. It creates the function of programming
easier because the programmer no longer requires to worry about the multiple physical
memory available.
Virtual memory works similarly, but at one level up in the memory hierarchy. A memory
management unit (MMU) transfers data between physical memory and some gradual
storage device, generally a disk. This storage area can be defined as a swap disk or swap
file, based on its execution. Retrieving data from physical memory is much faster than
accessing data from the swap disk.
There are two primary methods for implementing virtual memory are as follows −
 Paging
Paging is a technique of memory management where small fixed-length pages are
allocated instead of a single large variable-length contiguous block in the case of the
dynamic allocation technique. In a paged system, each process is divided into several
fixed-size ‘chunks’ called pages, typically 4k bytes in length. The memory space is also
divided into blocks of the equal size known as frames.

VIRTAL ADDRESS AND PHYSICAL ADDRESS[TOPIC-6]


Terms Logical Address Physical Address

the CPU generates the logical


The physical address is a location
Definition address while the program is
in memory.
running

The logical address does not exist


physically in the memory, and The physical address is a location
Location
therefore it is sometimes known in the memory unit.
as a virtual address.

Access The logical address is used as a The physical address cannot be


reference to access the physical
accessed directly.
address.

Whereas all
the physical
addresses
The set of all the logical mapped to
addresses generated about a the logical
Address space
program by the CPU is called address is
Logical Address Space. called
Physical
Address
Space.

LOCALITY OF REFERENCE[TOPIC-7]
Locality of reference refers to a phenomenon in which a computer program tends to
access same set of memory locations for a particular time period.
In other words, Locality of Reference refers to the tendency of the computer program to
access instructions whose addresses are near one another.
The property of locality of reference is mainly shown by loops and subroutine calls in a

program.
1. In case of loops in program control processing unit repeatedly refers to the set
of instructions that constitute the loop.
2. In case of subroutine calls, every time the set of instructions are fetched from
memory.
3. References to data items also get localized that means same data item is
referenced again and again.

In the above figure, you can see


that the CPU wants to read or fetch the data or instruction. First, it will access the cache
memory as it is near to it and provides very fast access. If the required data or instruction
is found, it will be fetched. This situation is known as a cache hit. But if the required data
or instruction is not found in the cache memory then this situation is known as a cache
miss. Now the main memory will be searched for the required data or instruction that
was being searched and if found will go through one of the two ways:
1. First way is that the CPU should fetch the required data or instruction and use it
and that’s it but what, when the same data or instruction is required again. CPU
again has to access the same main memory location for it and we already know
that main memory is the slowest to access.
2. The second way is to store the data or instruction in the cache memory so that
if it is needed soon again in the near future it could be fetched in a much faster
way.

CACHE MEMORY ORGANIZATION [TOPIC-8]


Cache memory is a small, high-speed storage area in a computer. The cache is a
smaller and faster memory that stores copies of the data from frequently used
main memory locations. There are various independent caches in a CPU, which
store instructions and data. The most important use of cache memory is that it
is used to reduce the average time to access data from the main memory.
By storing this information closer to the CPU, cache memory helps speed up the
overall processing time. Cache memory is much faster than the main memory
(RAM). When the CPU needs data, it first checks the cache. If the data is there,
the CPU can access it quickly. If not, it must fetch the data from the slower main
memory.
Characteristics of Cache Memory
 Cache memory is an extremely fast memory type that acts as a buffer
between RAM and the CPU.
 Cache Memory holds frequently requested data and instructions so that they
are immediately available to the CPU when needed.
 Cache memory is costlier than main memory or disk memory but more
economical than CPU registers.
 Cache Memory is used to speed up and synchronize with a high-speed CPU.
Levels of Memory
 Level 1 or Register: It is a type of memory in which data is stored and accepted
that are immediately stored in the CPU. The most commonly used register is
Accumulator, Program counter , Address Register, etc.
 Level 2 or Cache memory: It is the fastest memory that has faster access time
where data is temporarily stored for faster access.
 Level 3 or Main Memory: It is the memory on which the computer works
currently. It is small in size and once power is off data no longer stays in this
memory.
 Level 4 or Secondary Memory: It is external memory that is not as fast as the
main memory but data stays permanently in this memory.
 Cache Performance
 When the processor needs to read or write a location in the main memory, it
first checks for a corresponding entry in the cache.
 If the processor finds that the memory location is in the cache, a Cache Hit has
occurred and data is read from the cache.
 If the processor does not find the memory location in the cache, a cache
miss has occurred. For a cache miss, the cache allocates a new entry and copies
in data from the main memory, then the request is fulfilled from the contents
of the cache.
 The performance of cache memory is frequently measured in terms of a
quantity called Hit ratio.
 Hit Ratio(H) = hit / (hit + miss) = no. of hits/total accesses
Miss Ratio = miss / (hit + miss) = no. of miss/total accesses = 1 - hit ratio(H)
 We can improve Cache performance using higher cache block size, and higher
associativity, reduce miss rate, reduce miss penalty, and reduce the time to hit
in the cache.

MEMORY INTERLEAVING PRINCIPLES [TOPIC-9]


The interleaving principle is a teaching method that involves mixing multiple
subjects or topics while studying to improve learning. It's an evidence-based
strategy that's more effective than blocked practice, which is when you focus on
one topic at a time.
Here are some benefits of interleaving:
 Improves memory: Interleaving helps strengthen memory associations and the
ability to differentiate between concepts.
 Encourages connections: Interleaving helps learners make connections between
ideas and skills.
 Improves problem solving: Interleaving helps develop categorization and
problem solving skills.
 Strengthens associative memory: Interleaving helps learners learn and
remember the relationship between unrelated items.
 Maximizes long-term retention: Interleaving helps the brain store and keep
important information long-term.

You might also like