Co Unit-Iii

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

VSREDDY

UNIT-III
 Basic concepts of memory system
Introduction: Computer should have a large memory to facilitate execution of programs
that are large and deal with huge amounts of data. The memory should be fast, large, and
inexpensive. Unfortunately, it is impossible to meet all three of these requirements
simultaneously. Increased speed and size are achieved at increased cost.
The maximum size of the memory that can be used in any computer is determined by the
addressing scheme.
For example,
a. a 16-bit computer that generates 16-bit addresses is capable of addressing up to
216 = 64K (65536) memory locations.
b. Similarly, machines whose instructions generate 32-bit addresses can utilize a
memory that contains up to 232 = 4G (giga) memory locations,
c. whereas machines with 4O-bit addresses can access up to 240 = 1 T (tera) locations.
The number of locations represents the size of the address space of the computer.

From the system, we can view the memory unit as a black box. Data transfer between the
memory and the processor takes place through the use of two processor registers.
a. Usually called MAR (memory address register) and MDR (memory data register).
b. If MAR is k bits long and MDR is n bits long.
c. The memory unit may contain up to 2 k addressable locations.
d. During a memory cycle, n bits of data are transferred between the memory and the
processor.
e. This transfer takes place over the processor bus, which has k address lines and n
data lines.
f. The bus also includes the control lines Read / Write ( R / W ) and Memory Function
Completed (MFC) for coordinating data transfers.
g. Other control lines may be added to indicate the number of bytes to be transferred.
The connection between the processor and the memory.

Connection of the memory to the processor


Steps:-
a. The processor reads data from the memory by loading the address of the required
memory location into the MAR register and setting the R / W line to 1.
b. The memory responds by placing the data from the addressed location onto the data
lines, and con:irms this action by asserting the MFC signal.
c. Upon receipt of the MFC signal, the processor loads the data on the data lines into the
MDR register.
d. The processor writes data into a memory location by loading the address of this
location into MAR and loading the data into MDR.

1
VSREDDY

e. It indicates that a write operation is involved by setting the R/ W line to 0.


f. If read or write operations involve consecutive address locations in the main memory,
then a "block transfer" operation can be performed in which the only address sent to
the memory is the one that identi:ies the :irst location.
g. The time between the Read and the MFC signals is referred to as the memory access
time. The memory cycle time is the minimum time delay required between the
initiations of two successive memory operations,
h. If any location can be accessed for a Read or Write operation some :ixed amount of
time that is independent of the location's address in a memory unit is called random-
access memory (RAM).
i. One way to reduce the memory access time is to use a cache memory.
j. This is a small, fast memory that is inserted between the larger, slower main memory
and the processor. It holds the currently active segments of a program and their data.
k. Virtual memory is used to increase the apparent size of the physical memory. Data are
addressed in a virtual address space that can be as large as the addressing capability
of the processor.
l. But at any given time, only the active portion of this space is mapped onto locations in
the physical memory.
m. The remaining virtual addresses are mapped onto the bulk: storage devices used,
which are usually magnetic disks.
n. The virtual address space is mapped onto the physical memory where data are
actually stored. The mapping function is implemented by a special memory control
circuit, often called the memory management unit.

 Semiconductor RAM Memories


Semiconductor memories are the volatile memory storages that store the program
and data until the power supply to the system is ON. The cycle time of these
semiconductor memories ranges from 100 ns to 10 ns. The cycle time is the time from the
start of one access to the start of the next access to the memory.
Types of Semiconductor Memories
Semiconductor Memory
All the memory units are made of semiconductor material, especially silicon.
Semiconductor memories are used for storing digital data as they can be accessed faster.
The development over years in semiconductor technology has improved its accessing
speed, increased its capacity, and decreased the cost per bit.
The semiconductor memories are of two types volatile memory and non-volatile
memory.
o Volatile memory (such as RAM) is the memory that holds the data or
information until the power supply to the memory chip is ON.
o The non-volatile memory (such as ROM) unit holds the data or information
even if the power supply to the memory chip is OFF.
Internal Organization of Semiconductor Memory
The memory cells in the memory chip are organized in the form of an array where
each particular cell can hold one bit of information.

2
VSREDDY

o The :igure represents the memory circuit with 16 words (W0 to W15) where each
word has a word length of 8 bits (b0 to b7). So, this is referred to as 16×8 memory
organization.
o Memory cells of the same row or a word are connected via a common line which
we refer to as a word line. On the other hand, all the memory cells of a column are
connected to a sense/write circuit via two-bit lines. Further, the sense/ write
circuit is connected to data input and output lines.

Types of Semiconductor Memories


Semiconductor memories can be classi:ied into two types:
1. random access memory (RAM)
2. read-only memory (ROM)

Random Access Memory (RAM)

RAM being volatile memory, each of its addressable locations can be accessed in a very
short time. Each addressable location in RAM has a :ixed accessing time independent of
its location and prior accessing patterns. RAM can be classi:ied as either static RAM or
dynamic RAM.

1. Static RAM

In static RAM memories or SRAM, the content of the memory cell retains as long as the
power supply to the memory chip is ON. In any situation, if the power supply to the
memory chip is interrupted then the content of memory cells of static RAM is also lost.

When the power is resumed back to the memory chip there is no guarantee that the
memory cells may have the same content as they have before the interruption of the
power supply. This is the reason the static RAM is volatile in nature

2. Dynamic RAM

The static RAM is faster its memory cells require several transistors which makes it
expensive. So, to design a less expensive and higher density RAM we have to implement it
using simpler cells.

3
VSREDDY

But, the fact with the simpler cell is that the simpler cell does not hold data for a long
period until the data is accessed from the cell frequently either for read or write
operation. The memory circuit implemented using such simpler cells is referred to as
dynamic RAMs.

In dynamic RAM the information is stored in the memory cell by imposing the charge on
the capacitor. But the capacitor can hold charge only for tens of milliseconds and to hold
the content for a longer time the capacitor must be charged to its full value. The capacitor
is charged while its content is refreshed either by reading the contents from the cell or
writing new information to the cell.

Read-Only Memory (ROM)

Being a non-volatile memory, the ROM memories can only be read and not written.
ROM memories are written once at the time of their manufacturing. Once written the ROM
memories cannot be rewritten or modi:ied. Usually, the ROM memories store small
programs that are essential for ef:icient working of computers like system programs,
subroutines, etc.

ROM memories have various forms such as PROM, EPROM, EEPROM, and :lash memory.

1. Programmable ROM (PROM): PROM is written with the help of electric signals. PROM
can be written by the manufacturer or it even allows the user to write on PROM but it
requires some special equipment. It provides :lexibility as it lets users program it.

2. Erasable Programmable ROM (EPROM): It is more :lexible and user-oriented when


compared with PROM. Because the content of EPROM can be erased and memory can be
rewritten with new data. The memory cells of EPROM are made of transistors, to erase
the content of EPROM the charge on these transistors needs to be dissolved using
ultraviolet rays.

3. Electrically Erasable Programmable ROM (EEPROM)

The EEPROM can be programmed, erased, and read electrically. However, a different
voltage is required for each operation and this makes the circuit even more complex. But
the complexity of the circuit can be outweighed by many advantages of EEPROM.

4. Flash memory

The :lash memory is similar to EEPROM and uses electrically erasing technology. Flash
memory also allows selective erasure and selective writing of cells. The difference is that
the :lash memory can write an entire block of cells at once. The other difference is that
the :lash memory uses the same voltage to write, erase, and read the memory. This
reduces the complexity of the circuit and even consumes less power.

4
VSREDDY

 Speed, Size and Cost


The computer memory hierarchy looks like a pyramid structure which is used to describe
the differences among memory types. It separates the computer storage based on
hierarchy.
• Level 0: CPU registers
• Level 1: Cache memory
• Level 2: Main memory or primary memory
• Level 3: Magnetic disks or secondary memory
• Level 4: Optical disks or magnetic types or tertiary Memory

In Memory Hierarchy the cost of memory, capacity is inversely proportional to speed.


Here the devices are arranged in a manner Fast to slow, that is form register to Tertiary
memory.
Level-0 − Registers
The registers are present inside the CPU. As they are present inside the CPU, they
have least access time. Registers are most expensive and smallest in size generally in
kilobytes. They are implemented by using Flip-Flops.
Level-1 − Cache
Cache memory is used to store the segments of a program that are frequently
accessed by the processor. It is expensive and smaller in size generally in Megabytes and
is implemented by using static RAM.
Level-2 − Primary or Main Memory
It directly communicates with the CPU and with auxiliary memory devices through
an I/O processor. Main memory is less expensive than cache memory and larger in size
generally in Gigabytes. This memory is implemented by using dynamic RAM.
Level-3 − Secondary storage
Secondary storage devices like Magnetic Disk are present at level 3. They are used
as backup storage. They are cheaper than main memory and larger in size generally in a
few TB.
Level-4 − Tertiary storage
Tertiary storage devices like magnetic tape are present at level 4. They are used
to store removable files and are the cheapest and largest in size (1-20 TB).

Primary Secondary
Level Register Cache
memory memory
Bandwidth 4k to 32k MB/sec 800 to 5k MB/sec 400 to 2k MB/sec 4 to 32 MB/sec
Size Less than 1KB Less than 4MB Less than 2 GB Greater than 2 GB
Access time 2 to 5nsec 3 to 10 nsec 80 to 400 nsec 5ms
Managed by Compiler Hardware Operating system OS or user

5
VSREDDY

Memory hierarchy is arranging different kinds of storage present on a computing


device based on speed of access. At the very top, the highest performing storage is CPU
registers which are the fastest to read and write to. Next is cache memory followed by
conventional DRAM memory, followed by disk storage with different levels of
performance including SSD, optical and magnetic disk drives.

 Cache Memories

Is volatile memory that is used to store frequently accessed data for quick
retrieval. It acts as a buffer between the CPU (Central Processing Unit) and the main
memory (RAM - Random Access Memory), signi:icantly speeding up data access and
processing. Here are some key aspects of cache memory

Cache memory is sometimes called CPU (central processing unit) memory because it is
typically integrated directly into the CPU chip or placed on a separate chip that has a
separate bus interconnect with the CPU. Therefore, it is more accessible to the processor,
and able to increase ef:iciency.

Cache memory needs to be much smaller than main memory. Consequently, it has less
storage space. It is also more expensive than main memory, as it is a more complex chip
that yields higher performance.

Cache memory operates between 10 to 100 times faster than RAM, requiring only a few
nanoseconds to respond to a CPU request.

Types of cache memory


Cache memory is fast and expensive. Traditionally, it is categorized as "levels" that
describe its closeness and accessibility to the microprocessor. There are three general
cache levels:

1. L1 cache, or primary cache, is extremely fast but relatively small, and is usually
embedded in the processor chip as CPU cache.

2. L2 cache, or secondary cache, it can be on a separate chip or coprocessor and


have a high-speed alternative system bus connecting the cache and CPU.

6
VSREDDY

3. Level 3 (L3) cache is specialized memory developed to improve the performance


of L1 and L2. L1 or L2 can be signi:icantly faster than L3, though L3 is usually
double the speed of DRAM. With multicore processors, each core can have
dedicated L1 and L2 cache, but they can share an L3 cache.

Cache memory mapping


Cache memory traditionally works under three different con:igurations:

1. Direct mapped cache: the cache consists of normal high-speed random-access


memory. Each location in the cache holds the data, at a speci:ic address in the
cache. This address is given by the lower signi:icant bits of the main memory
address. This enables the block to be selected directly from the lower signi:icant
bit of the memory address.
2. Fully associative cache: This method is known as fully associative mapping
approach because cached data is related to the main memory by storing both
memory address and data in the cache. In all organisations.
3. Set associative cache mapping : In set associative mapping a cache is divided into
a set of blocks. The number of blocks in a set is known as associativity or set size.
Each block in each set has a stored tag. This tag together with index completely
identify the block.

Data writing policies


Data can be written to memory using a variety of techniques, but the two main ones
involving cache memory are:

Write-through: Data is written to both the cache and main memory at the same time.
Write-back: Data is only written to the cache initially. Data may then be written to main
memory, but this does not need to happen and does not inhibit the interaction from taking
place.

 Performance Considerations
Two key factors in the commercial success of a computer are performance and cost; the
best possible performance at the lowest cost is the objective. The challenge in considering
design alternatives is to improve the performance without increasing the cost.
Performance depends on how fast machine instructions can be brought into the
CPU for execution and how fast they can be executed.
`The main purpose of memory hierarchy is to create a memory that the CPU sees
as having a short access time and a large capacity. Each level of the hierarchy plays
an important role. The speed and ef:iciency of data transfer between various levels of
the hierarchy are also of great signi:icance. It is bene:icial if transfers to and from the
faster units can be done at a rate equal to that of the faster unit. This is not possible if
both the slow and the fast units are accessed in the same manner, but it can be achieved
when parallelism is used in the organization of the slower unit. An effective way to
introduce parallelism is to use an interleaved organization.

7
VSREDDY

Interleaving
Memory interleaving is a technique used in computer architecture to increase the
speed of memory access. It's a method of arranging memory storage to maximize the
throughput and minimize the access latency.
How It Works:
1. Parallel Access: When a processor accesses memory, it can retrieve data from
multiple modules simultaneously, as each module operates independently. This
parallelism increases the overall memory bandwidth.
2. Reducing Latency: Since each memory module gets more time to refresh between
accesses (as other modules are being accessed), it can reduce the effective latency.
3. Sequential Access Optimization: Interleaving is particularly effective for
sequential memory accesses, which are common in many applications. The
processor can access a series of data points without waiting for a single module to
complete all read/write operations.
Hit Rate and Miss Penalty
the memory hierarchy is the success rate in accessing information at various levels of the
hierarchy. Recall that a successful access to data in a cache is called a hit. The number of
hits stated as a fraction of all attempted accesses is called the hit Rate, and the miss rate
is the number of misses stated as a fraction of attempted accesses.
Caches on the CPU Chip
When information is transferred between different chips, considerable delays are
introduced in driver and receiver gates on the chips. Thus, from the speed point of view,
the optimal place for a cache is on the CPU chip. Unfortunately, space on the CPU chip is
needed for many other -functions; this limits the size of the cache that can be
accommodated.
 Virtual Memory
Virtual Memory is used in the computer memory to increase the storage capacity of the
main memory. It is a logical storage unit of a computer that creates an illusion to execute
a large program that may not be completely placed in the main memory. Furthermore, it
allows the user to load or store the data program or :iles larger than the size of the main
memory.

Advantages of Virtual Memory

1. Virtual Memory allows the users to run more than one application at once.
2. It enhances the degree of multiprogramming in the virtual memory.
3. Virtual Memory is a logical unit of computer memory that increases the main
memory capacity by storing or executing a large size program than the main
memory.
4. It does not require any :ixed limit on the degree of multiprogramming.
5. It increases the CPU utilization in the virtual memory.
6. It is required whenever the system does not have much space to store any big
programs or :iles.
8
VSREDDY

Disadvantages of Virtual Memory


1. Virtual Memory can slow the process of application in the system.
2. It may take more time to switch between the applications.
3. It reduces the stability of the system.
4. It allows the user to lesser hard disk space for its use in the system.

 Memory Management Requirements


Memory management keeps track of the status of each memory location, whether it is
allocated or free. It allocates the memory dynamically to the programs at their request
and frees it for reuse when it is no longer needed. Memory management meant to satisfy
some requirements
1. Relocation
2. Protection
3. Sharing
4. Logical Organization
5. Physical Organization

1. Relocation:
The programmer does not know where the program will be placed in memory
when it is executed while the program is executing, it may be swapped to disk and
returned to main memory at a different location (relocated). Memory references must be
translated into the code to the actual physical memory addresses.
The address generated by the CPU is said to be a logical address. An address
generated by MMU is called a physical address.

2. Protection:
Processes should not be able to reference memory locations in another process
without permission. It must be checked at run time. The memory protection requirement
must be satis:ied by the processor (hardware) rather than the operating system
(software).

The word protection means provide security from unauthorized usage of memory.
The operating can protect the memory with the help of base and limit register. Base
registers consisting of the starting address of the next process. The limit speci:ies the
boundary of that job, so the limit register is also said to be a fencing register.

3. Sharing:
Allow several processes to access the same portion of memory. It is better to allow each
process access to the same copy of the program rather than have their own separate copy.

4. Logical organization:
Programs are written in modules. Modules can be written and compiled independently.
Different degrees of protection given to modules (read-only, execute-only). Modules are
shared among processes.

5. Physical organization:
Memory available for a program plus its data may be insuf:icient. Overlaying allows
various modules to be assigned to the same region of memory.

9
VSREDDY

 Secondary Storage
This is also known as External Memory/Storage memory/Auxiliary memory/Backup
memory. It is used for storing data and instructions both permanently. It is also used to
transfer data from one computer to another. Secondary memory is not directly
accessible to the CPU. It is usually slower for operations like read/write, cheaper and
used in larger storage capacity.
Example: Hard disk, CD, DVD, Pen drive, etc.
Types of Secondary memory
1. Magnetic memory
2. Optical memory
Magnetic memory
Magnetic memory uses the property of a magnet for storing data. It is in use since the
:irst generation of computers. It contains data storing surface coated by magnetic oxide
compound. Magnetic memory is further divided as:
1. Magnetic Drum
Magnetic drum contains a metallic drum coated by magnetic oxide on the outer
surface of the drum, data is stored on this surface. It was in use in the :irst and
second generations of computers.
2. Magnetic tape
The magnetic tape contains a thin plastic ribbon, only one side of the ribbon is
used for storing data. The data storing side is coated by compound magnetic oxide.
It is a sequential access memory. So, the data read/write speed is slower. It mainly
used is for storing audio, video and backup data. It is highly reliable. It has a storage
capacity of 100MB-200GB. The width of the ribbon ranges between 4mm-1inch.
3. Magnetic disk
The magnetic disk contains a circular disc made of metal or plastic. Both sides of
the disc is usually used for storing data. The disc is coated with magnetic oxide.
The disc is divided into multiple concentric circles known as a track. Tracks are
further divided into a small areas known as sectors. Data are stored in sectors.
Example: Hard disk, :loppy disk, zip disk, Online Classroom Program disk,
Winchester disk, Jaz disk.
4. Hard disk
It is used as the main storage device of the computer. It uses 2-4 metallic disks
(platter). The disk is usually made of aluminium. Both sides of the disk are used
for storing data instead of the upper side of the uppermost disk and the lower side
of the lowermost disk. The data storing surface is coated with magnetic oxide. Each
data storing surface contains a separate read/write head. During data read/write
operations, the platter rotates at the rate of 3600-15000rpm. The hard disk is also
known as a hard drive because both data storing disk and data read/write
components are combined. It has a storage capacity of few megabytes to terabytes.
5. Floppy disk

10
VSREDDY

It contains a single plastic disk. Initially, it was used as the main storage device but
nowadays it is used for carrying data from one computer to another. It requires a
:loppy drive for its operation. It is unreliable and a hard disk because the data
storing surface is exposed. So, it may be affected by dust particles and magnetic
:ields.
Optical Memory
Optical memory uses the light beam for its operation. It is developed in the fourth
generation of computers. It is mainly used for storing audio/video, backup as well as
carrying data. It requires an optical drive for its operation. Its read/write speed is slower
compared to hard disk and :lash memories.
Example: CD, DVD, BD
1. CD
It stands for Compact Disk. It has a storage capacity of 700 MB or approx. to 90
minutes of standard audio. CD contains hard circular plastic; a single side of this
plastic is coated with aluminium alloy. This alloy stores data. It is protected by an
additional thin plastic covering. CD required CD drive for its operation.
Types of CD are:
-CD-R is a blank CD in which data can be stored once. After storing data it is
converted into CD-ROM.CD-ROM It cannot be erased or updated. CD-RW
can also be erased and used multiple times.
2. DVD
It stands for Digital Versatile Disk. It has a storage capacity between 4.7GB to 17GB.
Its shape and size are similar to CD but the difference in storage capacity is due to
different chemical components and data is compressed before storing. It requires
a DVD drive for its operation. The read/write speed of a DVD is slower than that of
a CD. Types of DVD are:
a. DVD-R
b. DVD-ROM
c. DVD-RW
d. DVD can also be classi:ied as:
1. Single-sided single-layered DVD (4.7GB)
2. Single-sided dual-layered DVD (7-8GB)
3. Dual-sided single-layered DVD (9GB)
4. Dual-sided dual-layered DVD (17GB)
3. BD
It stands for Blu-ray disk. It has a storage capacity of 25GB-50GB. It requires a BD
drive for its operation. Its shape and size are like CD and DVD. Types of BD are:
a. BD-R
b. BD-ROM
c. BD-RW
The working mechanism of CD
The surface of the CD contains land and pit. Land represents binary 1 and pit
represents binary 0. During the CD reading process, a beam of light is emitted

11
VSREDDY

which strikes the surface of the CD and gets re:lected. The re:lection is captured
by the lens in the CD drive. The difference in re:lection from land and pit is
identi:ied to determine 1 and 0. The land is in a crystalline form and the pit is in
amorphous form. The size of land and pit is smaller in DVD compared to CD.
Important Questions

Small questions

1. Explain random access memory (RAM)


2. read-only memory (ROM)
3. explain interleaving in memory.
4. Explain hit ration and miss penalty.
5. Explain concept of virtual memory.
6. Explain relocation in memory.
7. De:ine need of protection in memory.
8. Explain magnetic memory
9. Explain optical memory.
Large questions

1. Explain semiconductor RAM memories.


2. write Speed, Size and Cost of different memories.
3. explain cache memory in details.
4. define memory mapping for cache.
5. explain considerations for memory performance.
6. Explain memory management requirements.
7. De:ine secondary storage.

Assignments questions
Small questions

1. explain interleaving in memory.


2. Explain hit ration and miss penalty.
3. Explain concept of virtual memory.
4. Explain relocation in memory.
5. De:ine need of protection in memory.

Large questions

1. write Speed, Size and Cost of different memories.


2. explain cache memory in details.
3. de:ine memory mapping for cache.
4. explain considerations for memory performance.
5. Explain memory management requirements.

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy