COA Unit-4 Notes
COA Unit-4 Notes
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Memory Unit
In memory unit, memory stores or saves instructions and results. The
results can be saved permanently as well as temporarily. The data or
instruction once saved can be retrieve or recall or review whenever user
demands.
User can store huge amount of data and information as per
requirements. The user can use the data whenever needs.
The computer memory can be classified in Four different types:
• Internal Processor Memory (For CPU or Processor use)
• Main Memory|Primary Memory (RAM, ROM)
• Cache Memory (Computer Processor Use)
• Secondary Memory (Hard Disk, Optical Disk, Floppy Disk, Magnetic Tape)
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Memory Hierarchy-
The memories used in computer system are organized in a hierarchy.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Different Memory Units
Pen Drive
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Types of
Primary Memory
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
RAM & ROM Images
RAM
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Primary Memory
• RAM (Random Access Memory)-
• Random Access Memory is a form of computer memory that can be read and
changed in any order and is used to store working data and machine code.
• Random Access Memory device allows data items to be read or written in almost the
same amount of time irrespective of the physical location of data inside the memory.
• RAM is normally known as volatile memory where stored information is lost if power
is removed, although non-volatile RAM has also been developed.
RAM is also of two types-
SRAM (Static RAM)
DRAM (Dynamic RAM)
DRAM must be periodically refreshed.
SRAM is faster and more expensive
than DRAM. SRAM is typically used
for CPU cache while DRAM is used for
a computer's main memory.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
• ROM (Read Only Memory)- Read Only Memory is a memory from which
we can only read but cannot write on it. This type of memory is non-
volatile.
• The information is stored permanently in such memories during
manufacture. Data stored in ROM cannot be electronically modified after
the manufacture of the memory device.
• A 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.
Types of ROM-
1. PROM- Programmable Read-Only Memory
2. EPROM- Erasable Programmable Read-Only Memory
3. EEPROM- Electrically Erasable Programmable Read-Only Memory.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
• PROM-
• It is one type of ROM (Read Only Memory). The data in them is permanent and
cannot be changed.
• PROMs are used in digital electronic devices to store permanent data, usually low
level programs such as firmware or microcode.
• The key difference from a standard ROM is that the data is written into a ROM
during manufacture, while with a PROM the data is programmed into them after
manufacture.
• EPROM-
• Erasable Programmable Read Only Memory is a type of Programmable Read Only
Memory (PROM) chip that retains its data when its power supply is switched off.
• Computer memory that can retrieve stored data after a power supply has been turned off
and back on is called non-volatile.
• Once programmed on EPROM, an EPROM can be erased by exposing it to
strong ultraviolet light source.
• Today, EPROM chips are not used in computers and have been replaced by EEPROM chips.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
• EEPROM-
• Electrically Erasable Programmable Read Only Memory is a PROM that can
be erased and reprogrammed using an electrical charge.
• EEPROM was developed by George Perlegos at Intel in 1978 and unlike most
memory inside a computer, this memory remembers data when the power
is turned off.
• EEPROM was a replacement for PROM and EPROM and is used
computer's BIOS (Basic Input Output System) that were built after 1994.
• Having a computer with an EEPROM allows a computer user to update the
BIOS in their computer without having to open the computer or remove any
chips.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Types of
Secondary Memory
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Secondary Memory
• Secondary Memory is a memory where programs and data are kept on a
long-term basis.
• Secondary memory is computer memory that is non-volatile and persistent in
nature and is not directly accessed by a computer/processor.
• It allows a user to store data that may be instantly and easily retrieved,
transported and used by applications and services.
• Secondary memory is also known as secondary storage. Examples are the
hard disk and optical disks.
• Secondary memory is slow and cheap than primary memory.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Examples of Secondary Memory
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Hard Disk
• Hard Disk Drive (HDD), Hard Disk, Hard Drive is an electro-mechanical data
storage device that uses magnetic storage to store and
retrieve digital information.
• It uses one or more rigid rapidly rotating disks, referred as platters, coated
with magnetic material. The platters are paired with magnetic heads, usually
arranged on a moving actuator arm, which read and write data to the platter
surfaces.
• Data is accessed in a random-access manner. It means that
individual blocks of data can be stored or retrieved in any order and not
only sequentially.
• HDDs are a type of non-volatile storage, retaining stored data even when
powered off.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Floppy Disk
• Floppy Disk is a magnetic storage medium for computer systems.
• The floppy disk is composed of a thin, flexible magnetic disk sealed in a square
plastic carrier. In order to read and write data from a floppy disk, a computer system
must have a floppy disk drive (FDD). A floppy disk is also referred to simply as a
floppy.
• In early days of personal computing, floppy disks were widely used to distribute
software, transfer files, and create back-up copies of data.
• When hard drives were still very expensive, floppy disks were also used to store the
operating system of a computer.
• Size of Floppy Disk- 5.25-inch (133 mm), 3.5-inch (90 mm) Maximum Storage
capacity- 1.44 MB
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Optical Disc
• An optical disc is an electronic data storage medium that can be written to and
read from using a low-powered laser beam. Example- CD, DVD.
• CDs have a diameter of 120 millimeters (4.7 inch) and can hold up to about 1
hour and 20 minutes of uncompressed audio or about 700 MB of data. User can
read or write data onto the CD. The full form of CD is Compact Disc.
• DVD (Digital Versatile Disc) is a digital optical disc storage format invented and
developed in 1995. The medium can store any kind of digital data.
DVD is widely used for software, computer files, video programs, movies
watched using DVD players. DVDs offer higher storage capacity than compact
discs while having the same dimensions. DVD specification provided a storage
capacity of 4.7 GB for a single-layered, single-sided disc and 8.5 GB for a dual-
layered, single-sided disc.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
• Magnetic Tape- It is a medium for magnetic recording made of a thin, magnetizable
coating on a long, narrow strip of plastic film. It was developed in Germany in 1928,
based on magnetic wire recording. Devices that record and play back audio and video
using magnetic tape are tape recorders and video tape recorders respectively. A device
that stores computer data on magnetic tape is known as a tape drive.
• Pen Drive or USB Flash Drive, is a portable data-storage device. Pen drives have
replaced the floppy drives and have become the most popular data-storage devices
among consumers. Micro, lightweight and handy, a pen drive can be easily carried from
place to place by students, professionals, academicians and independent tech
consultants. Currently available pen drives with storage capacities ranging from 8GB and
32GB can be used to store graphics-heavy documents, photos, music files and video
clips.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
(Cache Memory)
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
About Cache Memory
•Cache memory is an extremely fast memory that acts as a buffer between RAM and
the CPU.
•Cache memory is a special memory with very high-speed. It is used to speed up
processing of CPU.
•Cache memory is costlier than main memory or disk memory but economical than CPU
registers.
•Cache is a smaller and faster memory holds frequently requested data and instructions
so that they are immediately available to the CPU when needed.
•Cache memory is used to reduce the average time to access data from the main
memory.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
How Does Cache Memory Work?
• Cache memory increases computer's performance. The cache memory is located very close to the
CPU.
• When the processor needs to read or write a location in main memory, it first checks cache memory
for a corresponding entry.
• If the processor finds that memory location in the cache, cache hit condition occurred and data is
read from cache.
•If the processor does not find the memory location in the cache, cache miss condition occurred.
•In cache miss condition, the cache allocates a new entry and copies data from 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.
1. Direct Mapping- In direct mapping, there is only one place in cache memory where a given block of data from RAM can
be stored. This means that the CPU only has to look in one place in the cache to see the data or instructions that it is
looking for are present, and if it is, it will be found very quickly.
2. Associative Mapping- Associative mapping is known as fully associated mapping. This is the opposite of direct mapping.
In this mapping any block of data or instructions from RAM can be placed in any cache memory block. This means that the
CPU has to search the entire cache memory to see data what it is looking for. The chances of a cache hit are much higher
in this mapping.
3. Set-Associative Mapping- Set-associative mapping allows each word that is present in the cache memory can have two or
more words in the main memory for the same index address.
• Set associative mapping combines the best of direct and associative cache mapping techniques.
• Set-associative mapping is a combination of direct and associative mapping.
The cache lines are grouped into sets. The number of lines in a set can vary from 2 to 16. The data can be stored in any of the
lines in the set.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Types of Cache
Primary Cache –
A primary cache is always located on the processor chip. This cache is small and its access time is comparable
fast to that of processor registers.
Secondary Cache –
Secondary cache is placed between the primary cache and the rest of the memory. It is referred to as the level 2
(L2) cache. Often, the Level 2 cache is also located on the processor chip.
Note- Computer cannot run without the cache. Cache helps CPU to speed up execution. Cache memory is not
any separate chip. It is integrated along with the processor and placed closer. Cache
memory is important because it improves the efficiency of data retrieval. It stores program, instructions and
data that are used repeatedly in the operation of programs which CPU is likely to used.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
(Virtual Memory)
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
What is Virtual Memory?
•Virtual Memory is a space where large programs can store themselves in form of pages
while their execution, and only the required pages or portions of processes are loaded into
the main memory.
•“ A computer can address more memory than the amount physically installed on the system.
This extra memory is actually called Virtual Memory and it is a section of a hard disk that's
set up to emulate the computer's RAM.”
•Virtual memory is a ”Memory Management Capability” of an operating system
which uses hardware and software to allow a computer to compensate for
physical memory shortages by temporarily transferring data from RAM to disk storage. This
process is done temporarily and is designed to work as a combination of RAM and space on
the hard disk.
•This technique is useful as large virtual memory is provided for user programs when a very
small physical memory RAM is there.
•Virtual memory provide benefits in terms of costs, physical space, multitasking
capabilities, and data security.
•Virtual Memory is a logical unit of computer memory that increases the capacity of
main memory by storing larger size program than
Computer Organization & Architecture (KCA-105)
the main memory in the computer
Slides Prepared By Prof. Asheesh Pandey, ABESEC
important jobs of virtual memory in Operating
What Is Demand Paging? Systems-
Demand Paging- Demand Paging is a method of Virtual
Memory Management. In this, when a process is swapped in, its
all pages are not swapped in at once. They are swapped in only
when the process needs them.
Initially only those pages are loaded which will be
required the process immediately.
The pages that are not moved into the memory are
marked as invalid in the page table.
In case of pages that are loaded in the memory, they
are marked as valid along with the information about
where to find the swapped out page.
Pages are only loaded when demanded by the
process. This is called Pure Demand Paging.
If the referred page is not present in the main
memory then there will be a miss and the concept is
called Page miss or page fault.
Virtual memory is also called lazy swapper because
the swapping of pages is done only when the CPU
requires it. Virtual memory is commonly
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
implemented in demand paging.
Page Replacement
In Demand Paging only certain pages of a process are loaded initially into the memory which allows us to get
more number of processes into the memory at the same time.
But problem occurs when a process requests for more pages and no free memory is available to bring
them in. So for solving this problem computer uses page replacement techniques/algorithms:-
1. Put the process in the wait queue, until any other process finishes its execution thereby freeing frames.
2. Remove some other process completely from the memory to free frames.
3. Find some pages that are not being used right now, move them to the disk to get free frames. This technique
is called Page Replacement and is most commonly used. We have some algorithms to carry on page
replacement efficiently. These algorithms are – Optimal Page Replacement Algorithms, Basic Page
Replacement Algorithm, FIFO Page Replacement Algorithm, LRU (Least Recently Used) Page Replacement
Algorithm.
Benefits of Virtual Memory:-
1. Large programs can be written, as virtual space is available compared to physical memory.
2. Less I/O required, leads to faster and easy swapping of processes.
3. More physical memory available, as programs are stored on virtual memory so they occupy very less space on
actual physical memory.
4. Simplified memory management, more efficient use of primary memory, increased capacity, program
isolation, and flexible memory allocation.
Disadvantage:- virtual memory operates at much slower speeds than computer RAM. If the OS juggles data
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
between virtual memory and RAM continuously, it can slow down the computer considerably.
2D and 2 1/2D Memory
Organization
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
2D and 2 1/2D Memory
• organization:-
The internal structure of Memory (RAM or ROM) is made up of memory cell that contain a memory bit.
• 8 bits form a byte.
• The memory is in the form of a multidimensional array of rows and columns. In which, each cell stores a bit and a
complete row contains a word.
• A memory simply can be divided into this below form-
2n = N where n= no. of address lines
N=total memory in bytes.
2n =Total words.
2D Memory organization –
1. In 2D organization, memory is divided in the form
of rows and columns(Matrix). MAR
2. Each row contains a word, now in this memory
organization, there is a decoder. A decoder is a
combinational circuit that contains n input lines
and 2n output lines.
3. One of the output lines of decoder selects the row
by the address contained in the MAR and the
word which is represented by that row gets MDR
selected and is either read or written through the
data lines. Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
Advantages:-
Simplicity: 2D memory organization is a simple and straightforward approach, with memory chips arranged in a
two-dimensional grid.
Cost-Effective: 2D memory organization is cost-effective, making it a popular choice for many low-power and
low-cost devices.
Low Power: 2D memory organization has low power consumption, making it ideal for use in mobile devices and
other portable electronics.
Disadvantages:-
Limited Bandwidth: 2D memory organization has limited bandwidth due to the sequential access pattern of
memory chips, which can lead to slower data transfer rates.
Limited Capacity: 2D memory organization has limited capacity since it requires memory chips to be arranged in
a two-dimensional grid, limiting the number of memory chips that can be used.
Limited Scalability: 2D memory organization is not scalable, making it difficult to increase memory capacity or
performance without adding more memory chips.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
21/2 D Memory organization –
• In 21/2 D organization the scenario is the same but we have two different decoders one is a column decoder and
another is a row decoder.
• Column decoder is used to select the column and a row decoder is used to select the row. The address from the
MAR goes as the decoders’ input.
• Decoders will select the respective cell through the bit outline, then the data from that location will be read or will
be written at that memory location.
Computer Organization & Architecture (KCA-105) Slides Prepared By Prof. Asheesh Pandey, ABESEC
2.5D Memory Organization:-
Advantages:-
Higher Bandwidth: 2.5D memory organization has higher bandwidth since it uses a high-speed interconnect
between memory chips, enabling faster data transfer rates.
Higher Capacity: 2.5D memory organization has higher capacity since it can stack multiple memory chips on top
of each other, enabling more memory to be packed into a smaller space.
Scalability: 2.5D memory organization is highly scalable, making it easier to increase memory capacity or
performance without adding more memory chips.
Disadvantages:-
Complexity: 2.5D memory organization is more complex than 2D memory organization since it requires additional
interconnects and packaging technologies.
Higher Cost: 2.5D memory organization is generally more expensive than 2D memory organization due to the
additional interconnects and packaging technologies required.
Higher Power Consumption: 2.5D memory organization has higher power consumption due to the additional
interconnects and packaging technologies, making it less ideal for use in mobile devices and other low-power
electronics.