0% found this document useful (0 votes)
34 views23 pages

CSO Unit 5 Notes

The document discusses memory organization in computer systems, detailing the hierarchy of memory including main memory, cache memory, and auxiliary memory. It explains the functions of RAM and ROM, the concept of associative memory, and the principles of cache memory operation. Additionally, it covers virtual memory, its address mapping, and common page replacement algorithms like FIFO and LRU.

Uploaded by

sussyimpostar69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views23 pages

CSO Unit 5 Notes

The document discusses memory organization in computer systems, detailing the hierarchy of memory including main memory, cache memory, and auxiliary memory. It explains the functions of RAM and ROM, the concept of associative memory, and the principles of cache memory operation. Additionally, it covers virtual memory, its address mapping, and common page replacement algorithms like FIFO and LRU.

Uploaded by

sussyimpostar69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Computer System

Organization
Course Code: INITCO7
Semester: 3
Section: ITNS, 1
UNIT 5:
MEMORY
ORGANIZATION
Memory Hierarchy
• The memory unit that communicates directly with the CPU is called
the main memory.
• Devices that provide backup storage are called auxiliary memory.
• A special very-high speed memory called a cache is sometimes used to
increase the speed of processing by making current programs and data
available to the CPU at a rapid rate.
• The cache memory is employed in computer systems to compensate
for the speed differential between main memory access time and
processor logic.
Main Memory
• The main memory is the central storage unit in a computer system.
• It is a relatively large and fast memory used to store programs and data during
the computer operation.
• The principal technology used for the main memory is based on semiconductor
integrated circuits.
• Integrated circuit RAM chips are available in two possible operating modes,
static and dynamic.
• The static RAM consists essentially of internal flip-flops that store the binary
information.
• The stored information remains valid as long as power is applied to the unit.
• The dynamic RAM stores the binary information in the form of electric charges
that are applied to capacitors.
• Most of the main memory in a general-purpose computer is made up
of RAM integrated circuit chips, but a portion of the memory may be
constructed with ROM chips.
• Originally, RAM was used to refer to a random-access memory, but
now it is used to designate a read/write memory to distinguish it from
a read-only memory, although ROM is also random access.
• RAM is used for storing the bulk of the programs and data that are
subject to change.
• ROM is used for storing programs that are permanently resident in the
computer and for tables of constants that do not change in value once
the production of the computer is completed.
• Among other things, the ROM portion of main memory is needed for
storing an initial program called a bootstrap loader.
• The bootstrap loader is a program whose function is to start the
computer software operating when power is turned on.
• Since RAM is volatile, its contents are destroyed when power is turned
off.
• The contents of ROM remain unchanged after power is turned off and
on again.
RAM Chip
Auxiliary Memory

Memory
connections to CPU
Magnetic Disks And Magnetic Tapes
Associative Memory
• The time required to find an item stored in memory can be reduced
considerably if stored data can be identified for access by the content of the
data itself rather than by an address.
• A memory unit accessed by content is called an associative memory or content
addressable memory (CAM).
• This type of memory is accessed simultaneously and in parallel on the basis of
data content rather than by specific address or location.
• When a word is written in an associative memory, no address is given.
• The memory is capable of finding an empty unused location to store the word.
• When a word is to be read from an associative memory, the content of the
word, or part of the word, is specified. The memory locates all words which
match the specified content and marks them for reading.
Cache Memory
• locality of reference
• If the active portions of the program and data are placed in a fast small
memory, the average memory access time can be reduced, thus reducing the
total execution time of the program.
• Such a fast small memory is referred to as a cache memory.
• The basic operation of the cache is as follows.
• When the CPU needs to access memory, the cache is examined.
• If the word is found in the cache, it is read from the fast memory.
• If the word addressed by the CPU is not found in the cache, the main
memory is accessed to read the word.
• A block of words containing the one just accessed is then transferred from
main memory to cache memory.
• The performance of cache memory is frequently measured in terms of
a quantity called hit ratio .
• When the CPU refers to memory and finds the word in cache, it is said
to produce a hit .
• If the word is not found in cache, it is in main memory and it counts as
a miss .
• The ratio of the number of hits divided by the total CPU references to
memory (hits plus misses) is the hit ratio.
• The basic characteristic of cache memory is its fast access time.
• Therefore, very little or no time must be wasted when searching for
words in the cache.
• The transformation of data from main memory to cache memory is
referred to as a mapping process.
• Three types of mapping procedures are of practical interest when
considering the organization of cache memory:
1. Associative mapping
2. Direct mapping
3. Set-associative mapping
• Example of cache memory
Virtual Memory
• Virtual memory is a concept used in some large computer systems that
permit the user to construct programs as though a large memory space
were available, equal to the totality of auxiliary memory.
• Each address that is referenced by the CPU goes through an address
mapping from the so-called virtual address to a physical address in
main memory.
• Virtual memory is used to give programmers the illusion that they
have a very large memory at their disposal, even though the computer
actually has a relatively small main memory.
• An address used by a programmer will be called a virtual address, and
the set of such addresses the address space .
• An address in main memory is called a location or physical address .
• The set of such locations is called the memory space .
• Thus the address space is the set of addresses generated by programs
as they reference instructions and data; the memory space consists of
the actual main memory locations directly addressable for processing.
• In most computers the address and memory spaces are identical.
• The address space is allowed to be larger than the memory space in
computers with virtual memory.
• When a program starts execution, one or more pages are transferred
into main memory and the page table is set to indicate their position.
• The program is executed from main memory until it attempts to
reference a page that is still in auxiliary memory.
• This condition is called page fault .
• Two of the most common replacement algorithms used are the first-in,
first-out (FIFO) and the least recently used (LRU).
• The FIFO algorithm selects for replacement the page that has been in
memory the longest time.
• Each time a page is loaded into memory, its identification number is
pushed into a FIFO stack. FIFO will be full whenever memory has no
more empty blocks.
• When a new page must be loaded, the page least recently brought in is
removed.
• The page to be removed is easily determined because its identification
number is at the top of the FIFO stack.
• The FIFO replacement policy has the advantage of being easy to
implement. It has the disadvantage that under certain circumstances
pages are removed and loaded from memory too frequently.
• The LRU policy is more difficult to implement but has been more
attractive on the assumption that the least recently used page is a better
candidate for removal than the least recently loaded page as in FIFO.
• The LRU algorithm can be implemented by associating a counter with
every page that is in main memory.
• When a page is referenced, its associated counter is set to zero.
• At fixed intervals of time, the counters associated with all pages
presently in memory are incremented by 1.
• The least recently used page is the page with the highest count.
• The counters are often called aging registers, as their count indicates
their age, that is, how long ago their associated pages have been
referenced.

You might also like