Unit-4 Coa

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

Notes By Prof.

Tanya Shrivastava

UNIT – 4

COMPUTER ORGANIZATION AND ARCHITECTURE


 MEMORY

Memory is simply storage. Without memory computer cannot store data for a long time. A memory is
just like a human brain. It is used to store data and instructions. Whenever you need a data with the help
of computer memory you can use it anytime.

When we enter the data into the computer using an input device, the entered information immediately
gets saved in the memory of the Central Processing Unit (CPU), the Memory Unit transmits the data
further to the other parts of the CPU.
Similarly, when the output of our command is processed by the computer, it is saved in the memory unit
before giving the output to the user.
Memory is primarily of two types −
 Primary Memory/Main Memory
 Secondary Memory

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Primary Memory:
Primary memory is also known as internal memory. These types of memories are present inside the
motherboard. For example: RAM, ROM, and CACHE memory are connected inside the motherboard.
Primary memory holds only those data and instructions on which the computer is currently working. It
has a limited capacity. It is divided into three subcategories Cache memory, RAM and ROM.

 Cache Memory – Level 1 cache, Level 2 cache, Level 3 cache


 RAM – SRAM, DRAM
 ROM – PROM, EPROM, EEPROM

CACHE MEMORY
Cache memory is smallest and fastest 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 RAM (main
memory). Cache is a primary memory. Cache memory is a temporary memory.

In the figure, data is transfer at slow speed from main memory to cache memory, but cache memory is a
fastest memory, so data is transfer from cache memory to the CPU at very high speed.

Three types of cache memories are:


 L1 cache
 L2 cache
 L3 cache

L1 cache L2 cache L3 cache


L1 Cache is also known as L2 Cache is also known as Level 2 L3 Cache is also known as
Level 1 Cache. Cache. Level 3 Cache.
If cache memory is directly If cache memory is built outside Both L1 and L2 cache is
built into the processor or the processor or CPU but inside built inside the processor or
inside the processor (CPU) the motherboard then it is known CPU then it is known as L3
then it is known as L1 as L2 cache. cache.
cache.

L2
CPU CPU CPU
L1 L1 L2

MOTHERBOARD
MOTHERBOARD MOTHERBOARD

Size - Smallest cache Larger than L1 but smaller than L3 Largest cache
Speed - Fastest cache Slower than L1 but faster than L3 Slowest cache

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Advantages

The advantages of cache memory are as follows −


 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

The disadvantages of cache memory are as follows −


 Cache memory has limited capacity.
 It is very expensive.

RAM – SRAM, DRAM


 RAM stands for Random Access Memory. RAM is a primary memory. RAM is volatile memory
means not permanent memory.
 It is a read/write memory which stores data until the machine is working. As soon as the
machine is switched off, data is erased.
 RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a
power failure.
 Provides temporary storage, store only running configurations.
 RAM is of two types −
 Static RAM (SRAM)
 Dynamic RAM (DRAM)

The difference between SRAM and DRAM are as follows:


SRAM DRAM

It stores information as long as the It stores information as long as the power is supplied or a few
power is supplied. milliseconds when power is switched off.

Transistors are used to store


information in SRAM. Capacitors are used to store data in DRAM.

Capacitors are not used hence no To store information for a longer time, contents of the
refreshing is required. (no refreshing) capacitor need to be refreshed periodically. (refreshing)

SRAM is faster compared to DRAM. DRAM provides slow access speeds.

It does not have a refreshing unit. It has a refreshing unit.

These are expensive. These are cheaper.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

SRAM DRAM

SRAMs are low-density devices. DRAMs are high-density devices.

In this bits are stored in voltage form. In this bits are stored in the form of electric energy.

These are used in cache memories. These are used in main memories.

Consumes less power and generates


less heat. Uses more power and generates more heat.

ROM – PROM, EPROM, EEPROM


 ROM stands for Read Only Memory. The memory from which we can only read but cannot
write on it. ROM is a primary memory.
 This type of memory is non-volatile means permanent memory. The information is stored
permanently in such memories during manufacture.
 A ROM stores such instructions that are required to start a computer. This operation is referred
to as bootstrap.
 Also it contains BIOS, BIOS is used to start the computer. As we start the computer the
bios checks the hardware and software of a computer whether it is working properly or
not, after checking bios start the computer in a few seconds.
 ROM chips are not only used in the computer but also in other electronic items like washing
machine and microwave oven.

Types of Read-Only Memory (ROM):


 PROM (Programmable read-only memory) – It can be programmed by the user. Once
programmed, the data and instructions in it cannot be changed.

 EPROM (Erasable Programmable read-only memory) – multiple times erase and reused with
the help of ultraviolet light.

 EEPROM (Electrically erasable programmable read-only memory) – multiple times erase and
reused with the help of electrical charge.

 MROM (Mask ROM) – Mask ROM is a kind of read-only memory that is masked off at the time
of production. Like other types of ROM, mask ROM cannot enable the user to change the data
stored in it. MROM cannot modify by user. User cannot change the data store in it.
If it can, the process would be difficult or slow. The very first ROMs were hard-wired devices that
contained a pre-programmed set of data or instructions. These kinds of ROMs are known as masked
ROMs, which are inexpensive.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Secondary Memory
Secondary memory is also known as external memory or non-volatile (permanent memory). These types
of memory are not present inside the motherboard they are externally connected to the system. For
example: CD, pen drive are externally connected to the system. It is slower than the main memory.
These are used for storing data/information permanently.
For example, disk, optical disk like CD, DVD, and magnetic disk like HDD, SSD, floppy disk, memory
storage like memory card, pen drive are secondary memory and externally connected to the system etc.
 Sequential Access – Magnetic Tape (Cassetes)
 Direct Access:
 Optical Disk: CD, DVD, Blu Ray Disc.
 Magnetic Disk: Floppy Disc, Zip Disk, HDD, SSD.
 Memory Storage Devices – Pen Drive, Memory Card.

Magnetic Tape:
 Magnetic audio tape is used to capture speech and music
 Magnetic video tape is used to capture video or any movie.
 Any video or music will play in a sequential manner.
 For example: cassettes

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 Cassettes are also known as magnetic tape, data is stored in this magnetic coated tape.
Data can be any video, music, speech, voice etc.

Magnetic Disk:
 Magnetic disk is a secondary memory.
 It is covered with magnetic coating to hold information.
 It can store large amount of data.
 Data can be read, write and modify easily.
 Some of the magnetic disk are: Floppy disk, zip disk, HDD, SSD.
 Data can be store in the form of concentric circles. Concentric means center is same but radius
and diameters are different of circles. These concentric circles are known as tracks used to store
data. Data stored in these tracks.

Floppy Disc
 Floppy disk has a magnetic coating on it, which is used to store data.
 Store less amount of data up to 1.44 MB.
 It is packed inside a black protective plastic envelop.
 Now they are not used because we need more space.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Zip Disc
 To read zip disk we need a zip drive, without zip drive we cannot read zip disk.
 Zip disk is an advance version of floppy disk.
 It contains more space as compare to floppy disk.
 It contains 100 MB and 250 MB of storage.
 Now they are not used because we need more space.

ZIP DRIVE

ZIP DISK

HDD (Hard Disk Drive)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Components of HDD:
Plotters: Hard disk consists of one or more circular disks known as plotters. These disk are made up of
metal. Each surface of plotter coated with magnetic coating.
Hard disk drive contains more storage like 1TB, 2TB etc. because it contains multiple disks to store
data.
Both the surface of each disk are capable of storing data except the top and bottom of the disk do not
contain the data only the inner surface of the disk is used to store data.
Outer side of the disk (top surface and bottom surface) do not used to store data only you can store data
inside part of the disk.
Recording Media: made up of magnetic material which is used to store data.
Read/Write Head: used to read and write the data on the disk.
Head Actuator: used to move the read/write head to store data on the disk.
Air filters: cleans the air circulating in the disk.
Spindle: used to spin the plotters, or to hold the plotters.
Motor: spin the hard disk plotters.
Logic board/Digital circuit board: used to control the functioning of hard disk.

SSD (Solid State Drive)


A solid-state drive (SSD) is a new generation of storage device used in computers. SSD which is
much faster than the traditional hard disks drive they've come to replace. HDD replace with SSD, SSD
is much faster than HDD.
SSDs are faster, more durable, more compact, quieter, and consume less energy. HDDs are more
affordable and may offer easier data recovery in the event of damage.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Optical Disk
 Optical disk is a secondary memory.
 It is covered with magnetic coating to hold information.
 It can store large amount of data.
 Data can be read, write and modify easily.
 Some of the optical disk are: CD, DVD, Blu Ray Disk.
 Data can be store in the single spiral track with the help of laser.

CD
 CD stands for compact disc. It is a secondary memory.
 It is a permanent memory; cd is portable means easy to carry.
 Used to store data such as software, music, text, document and video or movies.
 CD is a removable storage media.
 CD storage is 700 MB, CD is 1.2 mm thick and 4.7 inch (12 cm) diameter.
 CD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Aluminium: cd is reflective because disc is coated with thin layer of aluminium. Use Red laser
to write data.
Laquer/Acrylic: protect the cd layer, or to protect the data.
Label: enables you to name the cd for identification.
 CD types:
CD-ROM  Compact Disk-Read Only Memory. Only Read. file stored on CD can only read.
CD-R  Compact Disk-Recordable. Record data one time only.Data can be once written
cannot be erased. Read many and write once.
CD-RW  Compact Disk-rewriteable. Record and Erase data many times. Data can be read,
write and erase multiple times.
DVD
 DVD stands for digital versatile disc or digital video disc. It is a secondary memory.
 It is a permanent memory; dvd is portable means easy to carry.
 Used to store data such as software, music, text, document and video or movies.
 DVD is a removable storage media.
 As compare to CD, the DVD contains more storage. 7 more times compare to CD.
 DVD storage is 4.7 GB single sided and 8.5 GB double sided DVD is 1.2 mm thick and 4.7 inch
(12 cm) diameter.
 DVD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.
Aluminium: dvd is reflective because disc is coated with thin layer of aluminium. Use Red laser
to write data.
Laquer/Acrylic: protect the dvd layer, or to protect the data.
Label: enables you to name the dvd for identification.
 DVD types:
DVD-ROM/DVD+ROM  Digital Versatile Disk-Read Only Memory. Only Read. file stored
on DVD can only read.
DVD-R/DVD+R  Digital Versatile Disk-Recordable. Record data one time only.Data can be
once written cannot be erased. Read many and write once.
DVD-RW/ DVD+RW  Digital Versatile Disk-Rewriteable. Record and Erase data many
times. Data can be read, write and erase multiple times.

Blu Ray Disc (BD)


 BD stands for blu ray disc. It is a secondary memory.
 It is a permanent memory; BD is portable means easy to carry.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 Used to store data such as software, music, text, document and video or movies.
 BD is a removable storage media.
 As compare to CD & DVD, BD contains more storage.
 BD data storage is 25 GB single sided and 50, 60, 100,128 GB double sided, BD is 1.2 mm thick
and 4.7 inch (12 cm) diameter.
 BD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.
Aluminium: bd is reflective because disc is coated with thin layer of aluminium. Use Blue laser
to write data.
Laquer/Acrylic: protect the bd layer, or to protect the data.
Label: enables you to name the bd for identification.
 BD types:
BD-ROM/BD+ROM  Blu Ray Disk-Read Only Memory. Only Read. file stored on BD can
only read.
BD-R/BD+R  Blu Ray Disk-Recordable. Record data one time only. Data can be once
written cannot be erased. Read many and write once.
BD-RW/BD+RW  Blu Ray Disk-Rewriteable. Record and Erase data many times. Data
can be read, write and erase multiple times.

 MEMORY HIERARCHY

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

The computer memory can be divided into 5 major hierarchies that are based on use as well as speed. A
processor can easily move from any one level to some other on the basis of its requirements. These five
hierarchies in a system’s memory are register, cache memory, main memory, magnetic disc, and
magnetic tape.

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 behaviour of a program known as “Locality of references”.

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 or Main Memory


It consists of CPU registers, Cache Memory, and Main Memory. It is accessible directly by the
processor.

Design of Memory Hierarchy

1. Registers
 Register is an electronic component that is used to hold the information as bits.
 Register are used by processor (CPU) to store small amount of data.
 A register can be 2 bit register, 4 bit register, 8 bit register, 16 bit register,
32 bit register, 64 bit register etc.
 Register provides fast execution, fast accessing, fast fetching.
 CPU is a fast processor because it contains registers that provides fast speed.
 Register is a collection of various flip-flops.
 Flip flop means a single cell that is capable to store a single bit.
 1 cell = 1 flip-flop, 1 cell stores 1 bit.
Example: this 8 bit register contains 8 cells or we can say 8 flip-flops.

1 0 1 1 0 1 0 0
Types of Registers are:

 Program Counter (PC)


 Memory Address Register (MAR)
 Memory Data Register (MDR)/Memory Buffer Register (MBR)
 Instruction Register (IR)
 Accumulator (AC)
 Input Register (INPR)
 Output Register (OUTR)
 Temporary Register (TR)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

2. Cache Memory
Cache memory is smallest and fastest 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 RAM (main
memory). Cache is a primary memory. Cache memory is a temporary memory.

In the figure, data is transfer at slow speed from main memory to cache memory, but cache memory is a
fastest memory, so data is transfer from cache memory to the CPU at very high speed.

Three types of cache memories are:


 L1 cache
 L2 cache
 L3 cache

3. Main Memory
Main memory is also known as primary or internal memory. These types of memories are present inside
the motherboard. For example: RAM, ROM, and CACHE memory are connected inside the
motherboard. Primary memory holds only those data and instructions on which the computer is
currently working. It has a limited capacity. It is divided into three subcategories Cache memory, RAM
and ROM.

 Cache Memory – Level 1 cache, Level 2 cache, Level 3 cache


 RAM – SRAM, DRAM
 ROM – PROM, EPROM, EEPROM

4. Magnetic Disks
 Magnetic disk is a secondary memory.
 It is covered with magnetic coating to hold information. It can store large amount of data.
 Data can be read, write and modify easily. Some of the magnetic disk are: Floppy disk, zip disk,
HDD, SSD.
 Data can be store in the form of concentric circles. Concentric means center is same but radius
and diameters are different of circles. These concentric circles are known as tracks used to store
data. Data stored in these tracks.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

5. Magnetic Tape
 Magnetic audio tape is used to capture speech and music
 Magnetic video tape is used to capture video or any movie.
 Any video or music will play in a sequential manner.
 For example: cassettes
 Cassettes are also known as magnetic tape, data is stored in this magnetic coated tape.
Data can be any video, music, speech, voice etc.

Magnetic Audio Tape Magnetic Video Tape

 SEMICONDUCTOR RAM MEMORIES / SEMICONDUCTOR ROM MEMORIES

A semiconductor is a substance that has specific electrical properties that enable it to help as an
establishment for computers and other electronic devices. Semiconductor is a combination of
conductor and insulator.

Conductors are those substances through which electricity can flow are called conductors. Insulators
are those substances through which electricity cannot flow are called insulators. Some common
conductors are copper, aluminium, gold, and silver. Some common insulators are glass, plastic, rubber,
and wood.

There are mainly two types of semiconductor memory: random-access memory (RAM) and read-only
memory (ROM). RAM is a temporary data storage domain, whereas ROM serves is a permanent
storage.

 RAM stands for Random Access Memory. RAM is a primary memory. RAM is volatile memory
means not permanent memory.
 It is a read/write memory which stores data until the machine is working. As soon as the
machine is switched off, data is erased.
 RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a
power failure.
 Provides temporary storage, store only running configurations.
 RAM is of two types −
 Static RAM (SRAM)
 Dynamic RAM (DRAM)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

The difference between SRAM and DRAM are as follows:


SRAM DRAM

It stores information as long as the It stores information as long as the power is supplied or a few
power is supplied. milliseconds when power is switched off.

Transistors are used to store


information in SRAM. Capacitors are used to store data in DRAM.

Capacitors are not used hence no To store information for a longer time, contents of the
refreshing is required. (no refreshing) capacitor need to be refreshed periodically. (refreshing)

SRAM is faster compared to DRAM. DRAM provides slow access speeds.

It does not have a refreshing unit. It has a refreshing unit.

These are expensive. These are cheaper.

SRAMs are low-density devices. DRAMs are high-density devices.

In this bits are stored in voltage form. In this bits are stored in the form of electric energy.

These are used in cache memories. These are used in main memories.

Consumes less power and generates


less heat. Uses more power and generates more heat.

ROM – PROM, EPROM, EEPROM


 ROM stands for Read Only Memory. The memory from which we can only read but cannot
write on it. ROM is a primary memory.
 This type of memory is non-volatile means permanent memory. The information is stored
permanently in such memories during manufacture.
 A ROM stores such instructions that are required to start a computer. This operation is referred
to as bootstrap.
 Also it contains BIOS, BIOS is used to start the computer. As we start the computer the
bios checks the hardware and software of a computer whether it is working properly or
not, after checking bios start the computer in a few seconds.
 ROM chips are not only used in the computer but also in other electronic items like washing
machine and microwave oven.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Types of Read-Only Memory (ROM):


 PROM (Programmable read-only memory) – It can be programmed by the user. Once
programmed, the data and instructions in it cannot be changed.

 EPROM (Erasable Programmable read-only memory) – multiple times erase and reused with
the help of ultraviolet light.

 EEPROM (Electrically erasable programmable read-only memory) – multiple times erase and
reused with the help of electrical charge.

 MROM (Mask ROM) – Mask ROM is a kind of read-only memory that is masked off at the time
of production. Like other types of ROM, mask ROM cannot enable the user to change the data
stored in it. MROM cannot modify by user. User cannot change the data store in it.
If it can, the process would be difficult or slow. The very first ROMs were hard-wired devices that
contained a pre-programmed set of data or instructions. These kinds of ROMs are known as masked
ROMs, which are inexpensive.

 2D & 2.5D MEMORY ORGANIZATION

2D MEMORY ORGANIZATION 2.5D MEMORY ORGANIZATION


In 2D organization hardware is fixed but in 2.5D hardware changes.
2D Organization requires more gates 2.5D requires less gates
2D is more complex, because it has 1 decoder for 2.5D is less complex, because it has two
both row and column. decoders one for row and one for column
2D is more difficult 2.5D is less difficult

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Error correction is not possible in the 2D But in 2.5D error correction could be
organization. done easily.

In 2D organization memory is divided in the In 2.5D organization the scenario is the same
form of rows and columns (Matrix). Each row but we have 2 different decoders one is a
contains a word, in the memory organization column decoder and another is row decoder.
there is a single decoder a decoder is a Column decoder used to select the column
combinational circuit that contains n input and row decoder is used to select row.
lines and 2n output lines.

 AUXILIARY MEMORY: MAGNETIC DISK, MAGNETIC TAPE, OPTICAL DISKS

Magnetic Tape:
 Magnetic audio tape is used to capture speech and music
 Magnetic video tape is used to capture video or any movie.
 Any video or music will play in a sequential manner.
 For example: cassettes
 Cassettes are also known as magnetic tape, data is stored in this magnetic coated tape.
Data can be any video, music, speech, voice etc.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Magnetic Disk:
 Magnetic disk is a secondary memory.
 It is covered with magnetic coating to hold information.
 It can store large amount of data.
 Data can be read, write and modify easily.
 Some of the magnetic disk are: Floppy disk, zip disk, HDD, SSD.
 Data can be store in the form of concentric circles. Concentric means center is same but radius
and diameters are different of circles. These concentric circles are known as tracks used to store
data. Data stored in these tracks.

Floppy Disc
 Floppy disk has a magnetic coating on it, which is used to store data.
 Store less amount of data up to 1.44 MB.
 It is packed inside a black protective plastic envelop.
 Now they are not used because we need more space.

Zip Disc
 To read zip disk we need a zip drive, without zip drive we cannot read zip disk.
 Zip disk is an advance version of floppy disk.
 It contains more space as compare to floppy disk.
 It contains 100 MB and 250 MB of storage.
 Now they are not used because we need more space.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

ZIP DRIVE

ZIP DISK

HDD (Hard Disk Drive)

Components of HDD:
Plotters: Hard disk consists of one or more circular disks known as plotters. These disk are made up of
metal. Each surface of plotter coated with magnetic coating.
Hard disk drive contains more storage like 1TB, 2TB etc. because it contains multiple disks to store
data.
Both the surface of each disk are capable of storing data except the top and bottom of the disk do not
contain the data only the inner surface of the disk is used to store data.
Outer side of the disk (top surface and bottom surface) do not used to store data only you can store data
inside part of the disk.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Recording Media: made up of magnetic material which is used to store data.


Read/Write Head: used to read and write the data on the disk.
Head Actuator: used to move the read/write head to store data on the disk.
Air filters: cleans the air circulating in the disk.
Spindle: used to spin the plotters, or to hold the plotters.
Motor: spin the hard disk plotters.
Logic board/Digital circuit board: used to control the functioning of hard disk.

SSD (Solid State Drive)


A solid-state drive (SSD) is a new generation of storage device used in computers. SSD which is
much faster than the traditional hard disks drive they've come to replace. HDD replace with SSD, SSD
is much faster than HDD.
SSDs are faster, more durable, more compact, quieter, and consume less energy. HDDs are more
affordable and may offer easier data recovery in the event of damage.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Optical Disk
 Optical disk is a secondary memory.
 It is covered with magnetic coating to hold information.
 It can store large amount of data.
 Data can be read, write and modify easily.
 Some of the optical disk are: CD, DVD, Blu Ray Disk.
 Data can be store in the single spiral track with the help of laser.

CD
 CD stands for compact disc. It is a secondary memory.
 It is a permanent memory; cd is portable means easy to carry.
 Used to store data such as software, music, text, document and video or movies.
 CD is a removable storage media.
 CD storage is 700 MB, CD is 1.2 mm thick and 4.7 inch (12 cm) diameter.
 CD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.
Aluminium: cd is reflective because disc is coated with thin layer of aluminium. Use Red laser
to write data.
Laquer/Acrylic: protect the cd layer, or to protect the data.
Label: enables you to name the cd for identification.
 CD types:
CD-ROM  Compact Disk-Read Only Memory. Only Read. file stored on CD can only read.
CD-R  Compact Disk-Recordable. Record data one time only.Data can be once written
cannot be erased. Read many and write once.
CD-RW  Compact Disk-rewriteable. Record and Erase data many times. Data can be read,
write and erase multiple times.
DVD
 DVD stands for digital versatile disc or digital video disc. It is a secondary memory.
 It is a permanent memory; dvd is portable means easy to carry.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 Used to store data such as software, music, text, document and video or movies.
 DVD is a removable storage media.
 As compare to CD, the DVD contains more storage. 7 more times compare to CD.
 DVD storage is 4.7 GB single sided and 8.5 GB double sided DVD is 1.2 mm thick and 4.7 inch
(12 cm) diameter.
 DVD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.
Aluminium: dvd is reflective because disc is coated with thin layer of aluminium. Use Red laser
to write data.
Laquer/Acrylic: protect the dvd layer, or to protect the data.
Label: enables you to name the dvd for identification.
 DVD types:
DVD-ROM/DVD+ROM  Digital Versatile Disk-Read Only Memory. Only Read. file stored
on DVD can only read.
DVD-R/DVD+R  Digital Versatile Disk-Recordable. Record data one time only.Data can be
once written cannot be erased. Read many and write once.
DVD-RW/ DVD+RW  Digital Versatile Disk-Rewriteable. Record and Erase data many
times. Data can be read, write and erase multiple times.

Blu Ray Disc (BD)


 BD stands for blu ray disc. It is a secondary memory.
 It is a permanent memory; BD is portable means easy to carry.
 Used to store data such as software, music, text, document and video or movies.
 BD is a removable storage media.
 As compare to CD & DVD, BD contains more storage.
 BD data storage is 25 GB single sided and 50, 60, 100,128 GB double sided, BD is 1.2 mm thick
and 4.7 inch (12 cm) diameter.
 BD is made up of:
Polycarbonate Plastic: hard transparent plastic layer if the disk.
Aluminium: bd is reflective because disc is coated with thin layer of aluminium. Use Blue laser
to write data.
Laquer/Acrylic: protect the bd layer, or to protect the data.
Label: enables you to name the bd for identification.
 BD types:

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

BD-ROM/BD+ROM  Blu Ray Disk-Read Only Memory. Only Read. file stored on BD can
only read.
BD-R/BD+R  Blu Ray Disk-Recordable. Record data one time only. Data can be once
written cannot be erased. Read many and write once.
BD-RW/BD+RW  Blu Ray Disk-Rewriteable. Record and Erase data many times. Data
can be read, write and erase multiple times.
 ADDRESS MAPPING & REPLACEMENT

Mapping: transfer data from main memory to cache memory is known as mapping. Address mapping is
also known as Cache Memory Mapping.

Address mapping is interpreted if the data in the address space and the memory space are each split into
a collection of fixed sizes. The physical memory is broken down into sets of similar size known as
blocks, which can range from 64 to 4096 words each.
Example − Suppose a page or block consists of 1K words, then address space can be divided into 1024
pages and main memory can be divided into 32 blocks.
Three types of mapping are:

 Direct Mapping.
 Fully Associative Mapping.
 K-way Set Associative Mapping.

Direct Mapping:

The easiest technique used for mapping is known as direct mapping. The direct mapping maps every
block of the main memory into only a single possible cache line. In simpler words, in the case of direct
mapping, we assign every memory block to a certain line in the cache.

The simplest technique, known as direct mapping, maps each block of main memory into only one
possible cache line. or In Direct mapping, assign each memory block to a specific line in the
cache. An address space is split into two parts index field and a tag field.
TAG INDEX
In direct mapping the blocks of main memory is fix in to the cache memory lines. For example:

L0 B0 B0
1Block =
B1
L1 B1 B2 4 words
.
L2 B2
.
L3 B3 .
.
.
Cache Memory = 16 words .
.
1 Line = 4 words B1023

Main Memory = 1024 words

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Here the size of main memory = 1024 words


1 block = 4 words
Total no. of blocks in main memory = 1024/4 = 256 blocks

Now the size of cache memory = 16 words


I line = 4 words
Total no. of lines in cache memory = 16/4 = 4 lines

Now in Direct mapping we use the formula -


k mod n where k = block no. and n = total no. of lines in cache memory

If block is B0,
then k= 0 and n = 4
k mod n => 0 mod 4 = 0
hence the value of k mod n is 0, so block no. B0 of main memory is fix with the L0 line of cache
memory. Because size of block in main memory is 4 words and size of lines in cache memory is
also 4 words.

If block is B1,
then k= 1 and n = 4
k mod n => 1 mod 4 = 1
hence the value of k mod n is 1, so block no. B1 of main memory is fix with the L1 line of cache
memory. Because size of block in main memory is 4 words and size of lines in cache memory is
also 4 words.

So the limitation of direct mapping is the block of main memory is fix into the lines of cache
memory. B0 with L0, B1 with L1 etc.
Hence the blocks of main memory cannot be placed anywhere in the lines of cache memory. For
example B0 placed in L1 0r B1 placed in L2 is not possible.

Fully Associative Mapping:

The limitation of Direct Mapping is removed in Fully Associative Mapping.


In fully associative mapping, each main memory block is mapped to any cache memory line. This
means that any main memory block can come in any cache memory line. For example, B0 can come in
L0, L1, L2, and L3.
It stores both address and data. Address Data

Fully associative mapping based on the formula:


Block size = cache line.
Size of block in main memory = 4 words
Size of line in cache memory = 4 words
B0 = L1, B0 = L2 etc.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

L0 B1 B0
1Block =
B1
L1 B0 B2 4 words
.
L2 B3
.
L3 B1 .
.
.
Cache Memory = 16 words .
.
1 Line = 4 words B1023

Main Memory = 1024 words

Here the size of main memory = 1024 words


1 block = 4 words
Total no. of blocks in main memory = 1024/4 = 256 blocks
Now the size of cache memory = 16 words
1 line = 4 words
Total no. of lines in cache memory = 16/4 = 4 lines

K way Set Associative Mapping:

K way set associative mapping is the best mapping as compare to both direct mapping and fully
associative mapping. Because k way set associative mapping is the combination of direct mapping and
fully associative mapping.
K way set associative mapping = direct mapping + fully associative mapping
In k way set associative mapping, only cache memory is divided in to sets, but not the main memory.
K way set associative mapping based on the formula: No. of lines in cache memory
K

For example: in 2 way set associative mapping, K = 2, & no. of lines in cache memory is 4, hence
4/2 = 2, means cache memory is divided into 2 sets: Set 0 and Set 1

L0 B0 Here k way set associative mapping is a combination of direct


mapping and fully associative mapping.
L1 B0 Set 0
For example: in case of direct mapping, block B0 is fix in the Set 0
L2 of cache memory line. B0 will be store in set 0 but not in set 1.
Set 1
L3 In case of fully associative mapping Block B0 is store in any line
L0 or L1 of cache memory in set 0.
Cache Memory

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

For example: in 4 way set associative mapping, K = 4, & no. of lines in cache memory is 4, hence
4/4 = 1
Format of K way set associative mapping
L0 B0 Set 0
L1 B1 Tag Data Address
Set 1
L2 B1 Set 2
Tag Block Words
L3 B0
Set 3

Cache Memory

 VIRTUAL MEMORY

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 uses both the computer's software and hardware to work. It transfers processes between
the computer's RAM and hard disk by copying any files from the computer's RAM that aren't currently
in use and moving them to the hard disk. By moving unused files to the hard disk, a computer frees up
space in its RAM to perform current tasks, such as opening a new application. If the computer later needs
to use its RAM for a more urgent task, it can again swap files to make the most of the available RAM.

Virtual memory is defined as a memory management method where computers use secondary memory
to compensate for the shortage of physical memory.
Virtual memory provides benefits in terms of costs, physical space, multitasking capabilities, and data
security.
It is a technique that is implemented using both hardware and software. It maps memory addresses
used by a program, called virtual addresses, into physical addresses in computer memory.
Virtual memory is a method that computers use to manage storage space to keep systems running
quickly and efficiently. Using the technique, operating systems can transfer data between different types
of storage, such as random access memory (RAM), also known as main memory, and hard drive or
solid-state disk storage. At any particular time, the computer only needs enough active memory to
support active processes. The system can move those that are dormant into virtual memory until needed.

A virtual memory system has many advantages, including:

 Allowing users to operate multiple applications at the same time or applications that are larger
than the main memory
 Freeing applications from having to compete for shared memory space and allowing multiple
applications to run at the same time
 Allowing core processes to share memory between libraries, which consists of written code that
provides the foundation for a program's operations
 Improving security by isolating and segmenting where the computer stores information
 Improving efficiency and speed by allowing more processes to sit in virtual memory
 Lowering the cost of computer systems as you find the right amount of main memory and virtual
memory

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 Increasing the amount of memory available by working outside the limits of a computer's
physical main memory space
 Optimizing central processing unit (CPU) usage

2 types of virtual memory

The two ways computers handle virtual memory are through paging and segmenting. Here are some of
the differences between these types of virtual memory:

1. Paging

Paging is a virtual memory technique that separates memory into sections called paging files. When a
computer reaches its RAM limits, it transfers any currently unused pages into the part of its hard drive
used for virtual memory. The computer performs this process using a swap file, a designated space
within its hard drive for extending the virtual memory of the computer's RAM. By moving unused files
into its hard drive, the computer frees its RAM space for other memory tasks and ensures that it doesn't
run out of real memory.

2. Segmenting

Segmentation is another method of managing virtual memory. A segmentation system divides virtual
memory into varying lengths and moves any segments that aren't in use from the computer's virtual
memory space to its hard drive. Like page tables, segment tables track whether the computer stores the
segment in memory or a physical address. Segmentation differs from paging because it divides memory
into sections of varying lengths, while paging divides memory into units of equal size. With paging, the
hardware determines the size of a section, but the user can select the length of a segment in a
segmentation system.

Segmentation is often slower than paging, but it offers the user more control over how to divide
memory and may make it easier to share data between processes. You can customize the segments
based on the machine's purpose and usage.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 NUMERICALS

Q. What is the transfer rate of an eight-track magnetic tape whose speed is 120
inches per second and whose density is 1600 bits per inch?

Solution.

The tape moves at a speed s = 120 inches/second

Density of tape = 1600 bits per inch.

Total number of tracks = 8.

Data transfer rate per each track = tape speed x Density of tape.

= 120 * 1600 = 192000 bits / second.

8 bits = 1 byte.

Hence Data transfer speed per track = 192000 bits / 8 = 24000 Bytes / second.

Data transfer speed for 8 tracks = 24000 * 8 bytes / second.

= 192000 bytes / second = 192 KBytes / second. (∵ 1000 = 1 Kilo for speed calculation)
Q. Consider a cache consisting of 256 blocks of 16 words each for a total of 4096
words and assume that the main memory is addressable by a 16 bits address and it
consists of 4K blocks. How many bits are there in each of TAG, SET, WORD field
for 2-way set associative technique?

Solution.

In a 2-way set associative cache, each block in the cache can store two sets of words from main
memory. The cache in this question has 256 blocks with 16 words each, so there are a total of 512 sets
in the cache (256 blocks x 2 sets/block = 512 sets).

The main memory is addressable by 16-bit addresses, which means it can store 2^16 = 65,536 words.
Since each block in the main memory consists of 4k words, there are 65,536 / 4,096 = 16 blocks in the
main memory.

To determine the number of bits for the tag, set, and word in a 2-way set associative cache, we can use
the following formulas:

1. Number of bits for the word: log2(16) = 4 bits


2. Number of bits for the set: log2(512) = 9 bits
3. Number of bits for the tag: 16 - (4 + 9) = 3 bits

Therefore, the cache in this question has 4-bit words, 9-bit sets, and 3-bit tags.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Q. A two way set associative cache memory uses blocks of four words. The cache
can accommodate a total of 2048 words from main memory. The main
memory size is 128K × 32
a) Formulate all pertinent information required to construct the cache
memory. (Tag, index, data, blocks, words)
b) What is the size of cache memory.

Solution.

a) Main memory is represented as: 128K × 32


Main memory size = 128k words (1k = 1024 words)
= 27 × 210 words = 217
Memory address = 17 bits

Main memory word size = 32 bits

So, Data = 32 bits

Cache memory can store = 2048 words

The cache is 2 way set associative = 2048/2 = 1024 words = 210

So, Index = 10 bits 17 Bits

To find the tag the formula is: Tag = Address – Index


Tag Index
Address = 17 bits, index = 10 bits
7 bits 10 bits
Tag = 17 – 10 = 7 bits, Tag = 7 bits

Now cache memory uses 1 block of 4 words so, total words in cache memory is 1024 words, hence
total number of blocks in cache memory = 1024/4 = 256 blocks = 28 blocks.
17 bits
Block = 8bits
TAG Block Word
1 Block = 4 words = 22 words
7 bits 8 bits 2 bits
Word = 2 bits

b) TAG DATA TAG DATA


Cache
7 bits 32 bits 7 bits 32 bits 0
Memory of
: 1024 word
: 1023
2 way set associative cache memory divided by 2 then:
The size of one word in cache = 2(7 + 32) bits = 78 bits
So size of cache memory = Total no. of words * bits of one word in cache = 1024 words * 78 bits

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Size of cache memory = 1k * 78 bits

Q. A computer uses RAM chips of 1024*1 capacity.

a) How many chips are needed & how should their address lines be connected to
provide a memory capacity of 1024*8?
b) How many chips are needed to provide a memory capacity of 16 KB?
Solution.

a) Total no. of chips needed = Total RAM (memory) Size/ one RAM chip size

= 1024*8/ 1024*1

Total no. of chips = 8 chips

Address lines = 1024 = 210 = 10 address lines

b) Memory capacity = 16 KB = 16 * 1024 * 8 bits


1k = 1024 bits
B (1 byte) = 8 bits

Total no. of chips needed = Total RAM (memory) Size/ one RAM chip size

= 16 * 1024 * 8 bits/ 1024 *1


Total no. of chips = 128 chips

Q. The logical address space in a computer system consists of 128 segments. Each
segment can have up to 32 pages of 4K words each. Physical memory consists of
4K blocks of 4K words each. Formulate the logical and physical address formats.

Solution.

The logical address space has 128 segments x 32 pages x 4K words:

= 128 x 32 x 4 x 210

= 27 x 25 x 22 x 210 = 224

so we require 24 bits.

Physical memory has a 4K block x 4K word address space:

= 4 x 210 x 4 x 210

= 22 x 210 x 22 x 210 = 224

so we need 24 bits.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Both the two address spaces are the same size.

For logical address space, the address format would be:

7 bits for segment addressing

5 bits for page addressing

12 bit word addressing

segment - page – word (format of logical address)


23...17 - 16...12 - 11...0 (24 bits – range 0 to 23)

For physical address space, the address format would be:

12 bit block addressing

12 bit word addressing

word - block (format of physical address)


23...12 - 11...0 (24 bits – range 0 to 23)
Q. A digital computer has a memory unit of 64K X 16 and a cache memory of 1K
words. The cache uses direct mapping with a block size of four words.
a) How many bits are there in the tag, index, block, and word fields of the
address format?
b) How many bits are there in each word of cache, and how they are
divided into functions? Include a valid bit.
c) How many blocks can the cache accommodate?
Solution.

a) Main memory is represented as: 64K X 16

Main memory size = 64k words

= 64 * 1024 = 26 * 210 = 216

Address = 16 bits

Main memory word size = 16 bits

Data = 16 bits

Cache memory size = 1k words = 1024 words = 210

Index = 10 bits
16 bits address
Tag = Address – Index
TAG 6bits INDEX 10 bits
Tag = 16 – 10 = 6 bits

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Given 1 block = 4 words

Total words in cache memory = 1024 words

Total no. of blocks in cache memory = 1024/4 = 256 blocks = 28 blocks

Block = 8 bits
Tag 6 bits Block 8 bits word 2 bits
1 block = 4 words = 22 words

Word = 2 bits
16 bit address

0
Block 0
Block 1
.
.
.
.
.
Block 255 1023
Cache memory

b) Number of bits are there in each word of cache, Include a valid bit =

Valid bit = 1 bit


Valid bit Tag Data

1 bit 6 bits 16 bits

23 bits

c) Cache can accommodate = 1024/4 = 256 blocks = 28 blocks

Q. A block-set associative cache consists of a total of 64 blocks divided into 4 blocks


sets. The main memory contains 4096 blocks each consisting of 128 words.
 How many bits are there in main memory address?
 How many bits are therein each of the TAG, SET and WORD
fields?
Solution.

Given,
Number of blocks in cache memory = 64
Number of blocks in each set of cache = 4

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Main memory size = 4096 blocks = 212


Block size = 128 words = 27 words

Bits in Main Memory Address


Size of main memory = 4096 blocks = 212
= 212∗27
= 219
Hence there will be 19 bits in the main memory

Bits in Cache Memory Address (TAG, SET and Word Fields)


Size of main memory = 4096 blocks = 212
Hence the tag and set field combine will have 12 bits
TAG + SET = 12 bits
Number of sets = 64/4 = 16
SET = The cache is divided into 16 = 24 sets
SET = 4 bits
TAG = 12 bits - 4 bits = 8 bits
Each block consist of 128 words = 27 words
Hence the Word Field length will be 7 bits

 REPLACEMENT ALGORITHM in ADDRESS MAPPING

Data is continuously replaced with new data in the cache memory using replacement
algorithm. There are 2 types of replacement algorithm:

 FIFO – first in first out. Oldest item is replaced with the latest item.
 LRU – least recently used. Item which is least recently used by CPU is removed or
replaced.

Notes By Prof. Tanya Shrivastava

You might also like