1. 3
Computer Memory
3.1 Introduction
Memory in a computer system is required for storage and subsequent retreva o
the instructions and data. A computer system uses variety of devices tor sionig
these instructions and data which are required for its operations.
The storage devices along with the algorithm or information on how to control ano
manage these storage devices constitute the memory system of a computer
A memory system is a very simple system yet it exhibits a wide range of techinoiogy
and types. Ihe basic objective of a computer system is to increase the speeo o
computation. Likewise the basic objective of a memory system is to provide tast,
Uninieruprea access by the processor to the memory such that the processor cann
operate at the speed it is expected to work.
A memory stystem can be considered to consist of the three group of
memonies
Theseare
(a) Internal Processor Memories
These consist of the small set of high speed registers which are intermal to a
processor and are used as temporary locations where actual processing is done.
(b) Primary Memory or Main Memory
It is a large memory which is fast but not as fast as internal processor memory.
This memory is accessed directly by the processor. It is mainly based on
integrated circuits.
The memory is divided into a large no. of small parts. Each part is called a cell
or memory location. Each of these locations is assigned a unique number
called its address. The addresses vary from 0 to memory size minus one.
Forexample, If a computer has a memory of 63K words then this memory unit
has 63 x 1023 = 65536 memory location, each location storing a computer
word. The addresses of these locations very from 0 to 65535.
Each location can store a computer word. Word size change from computer
to computer. We can see the memory as shown in fig. 3.1.
UNIT-1
CF [ 37]
2. A d d r e s s
3
0
Cell or
Mernory
location
ome
FIGURE 3.1
mermony
(c) Secondary
Memory/Auxiliary Memory/Backing Store: Auxiliary men
in fact is much larger in sIze than main memony but is slower than main n
It normally stores system programs,
instructions and data files. Second
memory can also be used as an overflow memory in case the main mem
capacity has been exceeded. Secondary memories cannot be accesse
rred
directly by a processor. First the information of these memories is transferae
the
to the main memory and then the information can be accessed as tha
be accessed
information of main memory.
0 ns0 meleyje ionem
3.2 Characteristics ofMemory Systems
The following terms are most commonly used for identifying comparative behaviour
Cofvarious memory devices and technologies
1. Storage Location
There are three possible storage locations. omo smihg(
(a) Internal Storage : We define Internal Storage as storage which is needed
all the time and located inside also called Primary storage.
omefto(a)
beped
(b) External Storage : We define external storage as storage which is
osbel located outside of CPU but connected to CPU. It is also called secondary
storage. rohsool nomem e
no Put (c)
(c) CPU Registers: CPU alsohave its own local memory, in thetormo
registers.
2. Storage Capacity
Omem olgsk
nonssol viohon8pec030 08cer
It is the amount of data that can be stored in the storage unit. Ihe
stOia
capacty can be expressed in terms of Bytes. Storage units are
UNIT-1
CF [38]
3. (a) Bit
(Binary Digit): Abinary digit is
logical 0 or 1 representing a passive
or an active state of a component in an electric circunt
(b) Nibble : Agroup of four bits is called nibble.
(c)
A group of 8 bits is called byte, A byte is the smallest unit whicn
can
represent a data item or a
character
(d)
(d) Computer word (or word): A computer word like a byte, is
computer
a
to
of
Xed
numberofbits processed as a unit which varies from computer
word
COmputer but is fixed for each computer. The length of a
compui
s caled word-size or word length and it may be as small as 8
ois
stores
ay De as long as 96 bits. (i.e. 8, 16, 32, 64, 96 bits). A computer
the information in the from of computer ords.
Few higher storage units are
() Kilobyte (KB) 1KB = 1024 Bytes
(Gi) Megabyte (MB) 1 MB 1024 KB
(i) Giga Byte (GB) 1 GB 1024 MB
(iv) Tera Byte (TB) 1 TB 1024 GB
(v) Peta Byte (PB) 1PB 1024 TB
3. Unit of Transfer
Unit of Transfer can be word or block. For internal memory, generanyu
unit of transfer is equal to the word length. For external memory,data are often
transferred in much larger units than a word and these are referred to as
blocks.
4. Performance
There are three performance parameters. r tbee
(a) Access Time: Access timeis defined as time required to locate and
retrieve a record.
(b) Memory-Cycle Time: Memory-Cycle Time is defined as time passed
between initiation of two successive memory operations. (e.g. two read
operations) Hence, Memory-Cycle time consists of the access time plus
any additional time required before a second access can start.
(b)
(c) Access Rate: Access Rate is defined as number of Read/ Write
operations carried Out per second.
5. Access Method
Access Refers to the way the memory can be addressed or recorded
informationscan be accessed (Retrieved).. Various accessing methods are
CF [ 39]
IT-1
4. (a) Sequential Access
Memory
(SAM) : In this type c
(a)
one R/W head and each
location thete
M): In this type of
memory the
location of memory is accessed serial
Informations are
stored
as
record
orblockwise
and each
block isa
more inthis method
cordwise or blockwise
magnetic
tape.
This
Access
method is useful ifal0d.Exar
ma
E
mple i
accessed
from 1 to N.
Access
time is more int ndeach
cess
method is useful if all rero
are
ample
to be
p r o c e s s e d
as
shown in figure
3.2
R/WHead
b1b2/b3b4 b5 SAM
FIGURE 3.2
(b) Direct Access
Memory:
In tnis type
Or memory, each block
alled and Memory is called
time is less as compare
Direct
Access
Memory. In this memory,
Access time is less asco
disk. This is usefu
own
RW head, so any
block can be directlycalledand Memory i
to sequential
access
memory.
Example is magnetic disk. This is usck
when onlyparts of data are to be
processed.
CCess
(c)
where
access time is Independent
of location and each location's accece
time is same. Example is main memory.
c)
Random
Access Memory:
Another
aCcess
method israndomacce
ss
6. PhysicalType: A varietyofphysical typesofmemory
have been employed
6.
The two most
common types today are
s e m i c o n d u c t o r memory and magnetic
ontolstpe al 1elere lofou
memory.
7. Physical
Characteristic:
Various physical
characteristic of data storage
7.
are
Destructive Read Out : In this type of Memory as the contents are
read, they are wiped out i.e. information is lost as we read them. This is
called Destructive Read out. Magnetic Core Memories are such Memory
The solution to the problem is that each read operation is followed bya
write operation. i.e. read operation is in two parts, read and then wrnte
back.
(0) Dynamic Memories: In this type of Memories, Memory has the propery
that they tend to decay i.e. '1' tends to become '0' after a span of time
Some Semi Conductor Memories comes into this category. ThesolUd
to the problem is Refreshing i.e. after Periodic intervals informations aic
rewritten into this memory.
i)
(i) Volatile Memories: These are those memories where information aie
lost when power is turned off. Semiconductor Memory is of this typo
The solution to the problem is using of UPS.
T-1 CF [ 401
5. 3.3 Memory Hierarchy
Atypical memory hierarchy is shown in figure 3.3.
CPU
REGISTERs
INTEPIAL
MEMOPRY
CACHE MEMoRY
MAIN MEMORY
Speed
increases
As we move
p.
MAGNETIC DISK
EXTEPNAL
MEMORY
OPTICAL DISK
MAGNETIC TAPE
FIGURE 3.3
As one goes down the hierarchy, the following occur
() Increasing access time.
) Increasing capacity.
i) Decreasing cost per bit.
(iv) Decreasing frequency of access of the memory by the CPU.
Thus smaller, more expensive, faster memories are supplemented by larger, cheaper,
slower memories.
3.4 Difference between Primnary and Secondary Storage
PRIMARY STORAGE SECONDARY STORAGE
1 Temporary 1. Pemanent
2. Volaite 2 Non-Volalite
3. It is built into the CPU 3 It is housed in a separate unit
4 Slow
4 Fast
5. Limited capacity
6 Cost is high
7. access speed is high
direct access of data
Very large capacity
6. Cost is less
5.
7. access speed is low
8. direct access or sequential depend on
the device.
UNIT-1
CF [ 41
6. SEMI CONDUCTOOR
MAGNETIC CORE 1. Volatile
1. Non-volatile 2. Relatively small & light
2. Relatively large & heavy
3. High cost
3. Low cost
4. Non-destructive read out
5. Low powerconsumption
6 Available in a wide varity of size
4. Distructive read-out
5 High power
consumption
6 Available only in large
block
7. Relatively large
a c c e s s
time
Short access time
Small and medium sized
memory
8
8
Large sized memories
3 . 6 R A M ( R a n d o m - A c c e s s - M e m o r y )
and
program results. It is read/write memory. It is called random access memory(RAM
since access time in RAM is independent of the address to the word that is, eark
storage location inside the memory is as easy to reach as other location& takes tha
same amount of time. We can reach into the memory at random & extremely fast
but can also be quite expensive. RAM is volatile, i.e. data stored in it is lost when wa
switch off the computeror if there is a power failure. Hence a back up uninterruptible
A RAM constitutes the intemal memory
or tne cFU Tor storing data, program
AM)
ch
power system (UPS) is often used with computers.
RAM is small, both in terms of its physical size and in the amount of data it can hold.
RAM comes in the form of "discrete" (meaning separate) microchips and also in the
form of modules that plug into holes in the computer's motherboard. These holes
connect through a bus or set of electrical paths to the processor.
3.6.1 How does RAM Store Data nerdedeo-Y
RAM Consists of may capacitors and transistors. A capacitor and a transistor are
paired together to make a memory cell. The capacitor represents one "bit" of data,
the transistor is able to change the state of the capacitor to either a 0 or a 1. The 0's
and 1's when read in a
sequence represent the code which the computer
understands. i u 9
UNIT-1
CF [ 44]
7. Memory Modules
RAM
FIGURE 3.6
Let us take a
simple example of why RAM is used by the computer. When the CPU
loads an
application Program, such as a word processing into memory, t tacilitates
the application program to work as
speedily and efficiently as possible. The process
begins when the user enters a command from the keyboard. The CPU interprets
the command and instructs the hard disk to load' the command or
program into
main memory. Once the data is loaded into memory, the CPU is able to access t
much quickly as shown in fig. 3.7. The reason behind this is that main memory is
much faster than
secondary memory.
Data and instruction is
loaded into the main memory RAM
ieabo
HARDISK
gie
CPU
CPU instructs hard disk
MAS to load data and instruction
FIGURE 3.7 [Random Access Memory Interaction ]
CF [ 451
NIT-1
8. 3.7 Types ofRAM
RAM is of two typesS
() Static RAM (SRAM)
(i) Dynamic RAM (DRAM)
3.7.1 Static RAM (SRAM)
The word 'static'
indicates
that the
memory
retains Its contents
remains applied.
However,
data is lost when the power gets dow
retains its conternts as long as powar
The word powergets down due to volati
remains rs do
nature. SRAM chips use a matrix of
6 - t r a n s i s t o r s
and no capacitors T e .
on a
regular basis.
Because of the extra space
in the matrix, SRAM uses m
anufacturing
not require power to prevent
leakage,
so
SHAM need not have to he e
AM uses more chips
than DRAM for the same
amount ofstorage
space,
thus making the mand
dsto be
costs higher.
Static RAM is used as cache memory as cache memory
n e c e l .
very fast and small.
3.7.2 Dynamic
RAM (DRAM)
DRAM, unlike SRAM, must be continually'refreshed in order for it to maintain the
data. This is done by placing the memory on a refresh circuit that rewrites the data
several hundred times per
second. DRAM is used for most system memorybecause
itis cheap and small. All DRAMs are made up of memory cells. These cells are
composed of one capacitor and one transistor.
A Dynamic RAM stores information in the form of charge on a capacitor, which
leaks, away in a very short time. Therefore its contents must be periodically refreshed
after every two mill-seconds. A memory cell of DRAM stores only on bit either 0 or
1. The DRAM consumes less power and is cheaper then the SRAM. DRAM covers
less, space on computer's motherboard. It is produced in large sizes. A DRAM
needs only one transistor per memory cell and hence its package density Is HIgl.
3.7.3 Difference between Static RAM and Dynamic RAM
Diference between static and dynamic RAM is shown in table 3.2.
UNIT-1 CF [ 46]
9. TABLE 3.2
STATIC RAM
DYNAMIC RAM
1.SRAM retains its contents as long
as electrical power is applied to the
chip. Hence it has long data
1. DRAM has an extremelyshortdata
lifetime, typically about for milli
seconds.
lifetime.
2 There is no need to refresh. 2. Need to refresh
continuously
3. Slower as compared to SRAM
4. Used as RAM
5 Size is Less.
6 Less Expensive.
7. Less power consumption.
3. Faster.
4 Used as cache memory.
5. Larger size.
6. Expensive
7. High power consumption.
3.8 ROM (Read Only Momory)
The memory from which we can only read but cannot write on it. These are non-
volatile. The information is stored permanently in such memories during
manutacture. A ROM, stores such instructions as are required to start computer
when electricity is first turned on, this operation is referred to as
bootstrap. ROM
can also be used to store that software which is frequently needed by the computer.
ROM is also referred to as firmware, since it combines characteristic of both
hardware &software, that is to say, software embedded in hardware. Note that the
programs stored on ROM is called firmware. Other term used for firmware are
microcode & microprogram.
ROM chips are not only used in the computer but also in other electronic items lke
washing machine and microwave oven. CPU is attached to two kinds of memory:
RAM and ROM are shown in fig 3.8.
ROM
RAM
CPU
Motherboard
FIGURE 3.8
CF [ 471
UNIT-1
10. 3.8.1 Types ofROM
(a) MROM (Masked ROM)
The veryfirst ROMs were
h a r d - w i r e d
devices
that
c o n t a i n e d
a
pre-program
ed a pre-program
ked RO
setofdata or
i n s t r u c t i o n s .
These
kinds ofROMsare
known asmaskedRo
The contents ofsuch
ROMs
have
to be
specilied
b e t o r e chip
production
the actual data could be
used to
arrange
the
t r a n s i s t o r s
inside thechin
(b) PROM
( P r o g r a m m a b l e
Read only
Memory)
inside the chip It is
inexpensive ROM.
PROM is read-only
memory
(ROM)
that can be
m o d i f i e d onlyonce bya i e
contents using a PROM
The user buys a
blank
PROM
and
enters
the
desired
c o n t e n t s usinga PRO
nly
there are small fuse
p r o g r a m m e r
(PROM
burner).
Inside the
PROM
chipthe
are small
fe
The
which are burnt open (cut) during
p r o g r a m i m i n g .
" can De
programmed oni
As a result,
PROM is also known as
one-time
p r o g r a m m a b l e
(OTP) devica
Blank
PROMs are
economical.
PROM chips are
valueable
tor Companiss
that make their own
ROMs from
software theywrite,
because
when theychanga
their code theycan create new
PROMs
without requiring
expensive equipment
once and is not
erasable.
(c)
EPROM
(Erasable and
Programmable
Read Only Memory):
The EPROM can be erased by exposing it to ultra violet light for a duration of
upto 30 minutes. Usually, a EPROM eraser
achieves this function. During
programming an
electrical charge is trapped in an insulated gate region. The
charge is retained for more than ten years
because the charge has no leakage
path. Forerasing this charge, ultra violet light is passed through a quartz crystal
window (lid). This exposure to ultra violet light dissipates the charge. During
normal use the quartz lid is sealed with a sticker. 0091
An EPROM eraser is not selective; it will erase the entire EPROM. Although
EPROMs are more expensive than PROMs, their ability to be reprogrammed
makes them an essential part of the software development and testing process.
(d) EEPROM (Electrically Erasable and Programmable Read Only Memory):
The EEPROM is programmed and erased electrically. It can be erased and
reprogrammed about ten thousand times. Both erasing and programming take
about 3 to 10 ms (Milli seconds). In EEPROM, any location can be selectively
erased and programmed. EEPROMSs can be erased one byte at a time, rather
than erasing the entire chip. Hence the process of re-programming is flexible,
but slow. The biggest advantage of EEPROM is that it is non-volatile memory
and connot be updated easily while disadvantages are the high cost and &a
present they are not completely non-volatile and the write operation takes
considerable time. Both of these disadvantages are disappearing witn te
growth in technology.
UNIT-1
CF [ 48]
11. 3.8
Advantages of ROM
Non-volatile in nature
Easier to interface than RAMs
These can not be accidentally changed
Cheaper than RAMs
Easy to test
More Reliable than RAMs
These are static and do not require refreshing
contents are always known and can be veriied
3.9
3.9 Cache Memory
the
Cache memory is a very high-speed memory. which is placed between tm
processor and main memory as shown in fig. 3.9.
CPU
Cache Memory
Main Memory
FIGURE 3.9
RAM is much slower than the CPU. Therefore, moving data between RAM and the
CPU's registers is very time consuming operation.
o br
Motherboard
Data
bus
RAM
Cache
Clock
ROM
CPU
FIGURE 3.10
CF [ 491
UNIT-1
12. To solve this problem, a veryhigh-speed
The
memory
frequently used instructions aros
between processor and main memory.
have
The to access them again and aga
cache memory. This improves
the
overall eff
eed memory called "cache memory
is placed
are stored
in cache. So, the processor
does
not
have
they
to.
are made available to it from the
ain from
random access mory
(RAM)
b e c a u s e ,
they
all efficiency of computer
3.9.1 Levels of Cache
Level-1
Cache:
Sincethelate
1980'smostPC CPUs ha
built into them. This CPU
resident
cache is ofte
mory
C CPUs have cache
memory
ften called Level-1 (L1)
cache
There are two levels of cache
memo
)
(i) Level-2
Cache: In
addition to the cache memory built into the CP
()
also added to the
m o t h e r b o a r d .
This
m o t h e r b o a r d - r e s i d e n t cache isohae
Level-2 (L2)
cache. May PCs being sold today have 512 KB to 3
motherboard cache memory.
memory built into the CPU, cach
rd-resident cache is often ca
have 512 KB to 3MB
Today, many
CPUs
have as
much as 256 KB built in.
Exercise
1. Write a note on the storage capacity of a compute.
1.
Explain
various types of Primary
Memories in brief.
2.
Explain Magnetic Core Memory.
3 Explain Semi-Conductor Memory.
5 How does RAM store data?
5.
Explain the difference between magnetic core and semi conductor memories.
6
7. Explain RAM and various types of RAM.
8 Explain ROM and various types of ROM.
What is secondary storage? How does it differ from a primary storage?
10
9.
10. Define the terms: Bit, Byte, RAM, ROM, Access Time and Access Rate.
Note: Access Time: Access time is defined as time required to locate and
retrieve a record.
Access Rate: Access Rate is defined as number of R/W operation carried
out per second.
11. Describe various characteristics of memory system.
12 Explain the memory hierarchy.
13. What do you mean by Cache memory? What are its types?
O00
UNIT-1 5 0 1