You are on page 1of 61

Memory Management

By
Varsha Kapoor
Objectives
• Basic fundamentals related to primary memory and
secondary memory.
– Storage locations and addresses ,
– How to determine the capacity of the storage unit
– Fixed and variable word length storage organizations
• Primary Memory
– RAM
– ROM
– Registers
• Secondary Memory
– Access Method
– Types of Secondary Memory
Units of Measurement
Spatial units:
o  byte: 8 bits
o  kilobyte (KB): 1024 or 210 bytes
o  megabyte (MB): 1024 kilobytes or 220 bytes
o  gigabyte (GB): 1024 megabytes or 230 bytes
Time units:
o  nanosecond (ns) one- billionth (10-9 ) of a second
o  microsecond ( µ s) one- millionth (10-6 ) of a second
o  millisecond (ms) one- thousandth (10-3 ) of a second
Storage unit Criteria
• Access Time (fast)
• Storage Capacity (large)
• Cost per bit of storage (low)
Types of Memory
• Primary Memory (RAM)
– Holds data and programs used by a
process that is executing
– Only type of memory that a CPU deals
with
• Secondary Memory (i.e. hard disk)
– Non-volatile memory used to store data
when a process is not executing
1. Primary Storage

• Primary Storage of a computer , also called


as its main memory, is used to hold the
program instructions & data, intermediate
result of processing , & recently produced
results on which the computer is currently
working.
• These piece of information are represented
electronically in the main memory chip’s &
while it remains in the main memory , cpu can
access it directly at a very fast speed.
However , primary storage can hold
information only while computer system is on.
• As soon as the computer system switches
off or resets, the information held in primary
memory is erased.
• Moreover , primary storage normally has
limited storage capacity because it is very
expensive.
Storage Location and
Address
• The Primary or internal storage section is made up of
several small storage locations (ICs) called cells. Each of
these cells can store a fixed number of bits called word
length.
• Each cell has a unique number assigned to it called the
address of the cell and it is used to identify the cells.
• A given memory is divided into N words , where N generally
is some power of 2. Each word has a number or address
assign to itself. Each word can store either a data item or an
instruction
• The address starts at 0 and goes up to (N-1). the memory is
like a large cabinet containing as many drawers as there are
addresses on memory. Each drawer contains a word and the
address is written on outside of the drawer.
Storage Location and Address
(Contt.)
• The Primary or internal storage section is made up of
several small storage locations (ICs) called cells.
Each of these cells can store a fixed number of bits
called word length.
• Each cell has a unique number assigned to it called
the address of the cell and it is used to identify the
cells.
• A given memory is divided into N words , where N
generally is some power of 2. Each word has a
number or address assign to itself. Each word can
store either a data item or an instruction
• The address starts at 0 and goes up to (N-1). the
memory is like a large cabinet containing as many
drawers as there are addresses on memory. Each
drawer contains a word and the address is written on
outside of the drawer.
Organization of a Primary Storage
Unit having N- words

}
0       
1       
2       
3       
4       
Addresses

5       
The words of a 
       
primary Storage 
Unit
   

   

   

N-2        
Each word 
N-1      =====  
contains the same 
Bit1  Bit 2
number of bits = word length
Storage Capacity
• In Bytes
• Words :We need to know
– the total number of bits per word
– Total number of Words
– A memory with 4096 locations each with
different address and with each location
storing 16 bits is called a 16 bit 4096 word
memory or 4K 16 bit memory.
– If the word size is 8 bits then it becomes
immaterial whether the memory capacity is
expressed in bytes or words.
– More bits per word more rapid flow of elctronic
signals and faster computers
Fixed and Variable word length
Storage 0025B
0026O
0051D
0052E
0027M 0053L
0028B 0054H
<---------- word-------------
0029A 0055I
0501    B O M B A Y
0030Y 0056 
0502      D E L H I
0031   
0503               

|
 
               
 

|
 
               
 

1024                |  

|
 

Address 
|
 

Number 4096 

4096 
Difference Between variable and
Fixed Word Length
Fixed Variable
• storage space may be • make the most efficient
wasted use of available storage
• computers have faster space
calculating speeds . They • Slower . only one digit
can add two data words in (byte) in each number can
a single operation be added during a single
• Used in larger mainframe machine operation. Thus,
computers , super- eight steps are required to
computers like the CRAY-1 complete the calculation
• Used in microcomputers
Most of today’s business and scientific processing is handled by
flexible computers (in terms of the instruction set) which can
employ either fixed or variable word length.
Memory Hierarchy

Fast, Small,
Cache
Experience

Main Memory (RAM)

Slow,
Magnetic Disk
Large, Cheap

Magnetic Tape
Memory Hierarchy
– At the primary storage level, the memory
hierarchy giabytes of data in DRA, in some
cases, entire databases can be kept in the
main memory (with a backup copy on
magnetic disk), leading to main memory
databases. includes, at the most expensive
end’ cache memory, which is a static RAM
(Random Access Memory).
– The next level of primary storage is DRAM
(Dynamic RAM), The advantage of DRAM is
its low cost, lower speed compared with
static RAM.
– Programs normally reside and execute in
DRAM.
Primary Memory
• RAM Large memory, which is fast but
not as fast as internal processor
register.
• Processor directly accesses this
memory.
• It is mainly based on integrated
circuit.
• Read/Write Memory
Types of RAM
1. Static RAM (SRAM):
• Doesn’t need refreshing 
• Retains contents as long as power applied to the 
chip
• Access time around 10 nanoseconds
• Used for cache memory 
• Also for date and time settings as powered by small 
battery
Types of RAM
2. Dynamic Random Access Memory (DRAM)
• Contents are constantly refreshed 1000 times per second
• Access time 60 – 70 nanoseconds
Note: a nanosecond is one billionth of a second!

3. Synchronous Dynamic Random Access Memory (SDRAM)


• Quicker than DRAM
• Access time less than 60 nanoseconds

4. Direct Rambus Dynamic Random Access Memory (DRDRAM)


• New type of RAM architecture
• Access time 20 times faster than DRAM
• More expensive
Types of RAM
5. Cache memory
• Small amount of memory typically 256 or 512 kilobytes
• Fast small Memory between CPU and main memory
• Temporary store for often used instructions 
• Also called as small high speed buffer
• Level 1 cache is built within the CPU (internal)
• Level 2 cache may be on chip or nearby (external)
• Faster for CPU to access than main memory
• Temporary data frequently needed in present calculations/ store segments 
of programs currently being executed 
The operation of cache memory

1.  Cache  fetches  data  2.  CPU  checks  to  see 


from  next  to  current  whether  the  next 
addresses  in  main  instruction it requires is in 
memory cache

Main Cache
Memory Memory CPU
(DRAM) (SRAM)

3.  If  it  is,  then  the 


4.  If  not,  the  CPU  has  to 
instruction  is  fetched 
fetch  next  instruction 
from  the  cache  –  a  very 
from  main  memory  -    a 
fast position
much slower process

= Bus connections
Types of RAM
6. Video Random Access memory
• Holds data to be displayed on computer screen
• Has two data paths allowing READ and WRITE to occur at the same time
• A system’s amount of VRAM relates to the number of colours and resolution
• A graphics card may have its own VRAM chip on board

7. Virtual memory
• Uses backing storage e.g. hard disk as a temporary location for programs 
and data where insufficient RAM available
• Swaps programs and data between the hard-disk and RAM as the CPU 
requires them for processing
• A cheap method of running large or many programs on a computer system
• Cost is speed: the CPU can access RAM in nanoseconds but hard-disk in 
milliseconds (Note: a millisecond is a thousandth of a second)
• Virtual memory is much slower than RAM
Microprograms
• Special programs written to perform the
complicated electronic circuits
• 196 nanoseconds
• Deal with low level machine functions and
are substitutes for additional hardware.
• Are written to aid the control unit in
directing all operations of the computer
systems
• ROMs are used by computer manufacturers
for storing Microprograms so that they
could be modified by the users
ROM
• essential component of the memory unit
• This memory is permanent and is not erased
when the system is switched off
• can be read only and not be written by user/
programmer.
• ROM varies from 64 KB to 256 KB
• Permanent Stores or Dead stores or field
stores
Types of ROM
ROM available for microcomputers
• Mask ROM:
– Mask ROM is the basic ROM chip.
– information is stored at the time of its
manufacturing.
– cannot be altered or erased later on.
• PROM:
– PROM stands for Programmable Read Only
Memory.
– the information is stored by programmers
after its manufacturing.
– cannot be altered or erased later on.
Types of ROM
ROM available for microcomputers
• EPROM:
– EPROM stands for Erasable Programmable
Read Only Memory.
– It is similar to PROM, but its information can
be erased later on by ultra violet light
– it can be reprogrammed.
• EEPROM:
– EEPROM stands for Electrically Erasable
Programmable Read Only Memory.
– It is similar to EPROM, but its information can
be erased by using a high voltage current.
Types of ROM
ROM available for microcomputers
• EAPROM:
– EAPROM stands for Electrically Alterable Read Only
Memory.
– As compared to EPROM and EEPROM, the information
stored in EAPROM can be altered later.

• Flash ROM
– Similar to EEPROM
– However, can be reprogrammed while still in the
computer
– Easier to upgrade programs stored in Flash ROM
– Used to store programs in devices e.g. modems
– Access time is around 45 – 90 nanoseconds
Memory Hierarchy-flash memory
– Flash memory, since 1988 it has become
common, particularly because it is
nonvolatile, using EEPROM (Electrically
Erasable Programmable Read-Only
Memory) technology. Its life is 10,000-
1,000,000 times erase… Read/write is
fast, but erase is slow…
– Therefore special arrangements are
made for the file system, regarding file
delete or update.
– Capacities up to 128 GB has been
realized todate.
Types of ROM
ROM available for microcomputers
• ROM cartridges
– Similar to EEPROM
• Commonly used in games machines
• Prevents software from being easily copied
Memory configurations for Intel CPU’s
Registers
• Internal Processor memories
• Not a part of RAM
• High speed temporary memory
locations
• Length of the register denotes the
number of bits it can store
Types Of Registers
• MAR: Active Memory Location
• MBR: Holds the contents of memory word read
from or written in memory
• PC :address of next instruction to be executed
• ACR: Initial data / immediate results / final
result of the operation
• IR : current instruction being executed
• I/O R:
Secondary Storage.
• Secondary storage of a computer also know as
auxiliary storage or Backup storage, is used to
take care of the limitation of Primary Storage.
• That is , it supplements the limited storage
capacity, Cost per bit of storage & the volatile
characteristic of primary storage.
• This is because secondary storage is much
cheaper than primary storage & it can retain the
information even when a computer system
switches off.
• Magnetic disk is the most commonly used
secondary storage medium.
Access Methods
Two major types of secondary storage devices
• Sequential
– Magnetic tapes (very fast sequential access)
– Monthly pay slips
– Electricity Bills
• Magnetic tapes (very fast sequential access)
– Getting the Bank account statement
– Magnetic Discs
Hard disks (high capacity, low cost, fast)
Floppy disks (low capacity, lower cost, slow)
– Optical Disks
CD-ROM = (Compact disc, read-only memory
Categories Of Storage
• Punched paper tapes
• Magnetic
– Floppy disks
– Zip disks
– Hard drives
• Optical
– CD-ROM
– DVD
• Solid state storage devices
– USB Key (a very common form of solid state 
storage)
34
Punched Paper Tape

Disadvantages:
•No of characters stored in the given space is less
•Paper tape media is easily torn and mutilated  
•Cost per bit stored is very low
Magnetic Tape
• Sequential Access
• Medium for Large Data
• Same as tape used on tape recorder except that it is of
high quality and more durable
• Can be erased and used indefinitely
• Frames (Vertical columns) and Channels/Tracks
(horizontal rows )
• Older tapes has 7 tracks and they used the 6 bit BCD
code format for data recording
Magnetic Tape
• Parity Bit or Check Bit
• Most modern magnetic tape have 9
tracks ad they use 8 bit EBCDIC code
• Magnetic tape drive is a machine that can
either read data from a tape into the CPU
or it can write the information being
produced by computer into a tape
Quality measurement of
Magnetic Tape
• Data Transfer Rate : Tape Density * Tape Speed
• Tape Density : no of frames that can be
compressed into 1 inch tape. (CPI)
• 556 BPI, 800 BPI, 1600 BPI, 3250 BPI , 6250 BPI
• Tape Speed: inches per second
• Data Transfer rate : 1 million bytes per second
Parity or Check bit
• A parity bit is a bit that is added to
ensure that the number of bits with
the value one in a set of bits is even
or odd.
• Parity bits are used as the simplest
7 form of
bits of data error
8 detecting
bits Even code.
Odd
including parity
(number of 1s)
00000000 00000000 10000000
1010001 (3) 11010001 01010001
1101001 (4) 01101001 11101001
1111111 (7) 11111111 01111111
Advantages of Magnetic
Tapes
• Unlimited Storage
• High Data Density
• Low Cost
• Rapid Transfer Rate
• Ease of handling
• Portability
Limitations of Magnetic
Tapes
• No Direct access
• Indirect Interpretation
• Environment Problems
Magnetic Storage
• Exploits duality of magnetism and
electricity
– Converts electrical signals into magnetic
charges
– Captures magnetic charge on a storage
medium
– Later regenerates electrical current from
stored magnetic charge
• Polarity of magnetic charge represents
bit values zero and one
1. Magnetic Drives
Magnetic Disk
• Flat, circular platter with metallic coating that is rotated
beneath read/write heads
• Direct Access Secondary Storage
• A disk pack consist of number of these disks three or more
mounted about half and inch apart from each other on a
central shaft which rotates at speed of 2400 or more rpm
• Random access device; read/write head can be moved to
any location on the platter
• Hard disks and floppy disks Cost performance leader for
general-purpose on-line secondary storage
Magnetic Disk
• Storage Of Information
• Storage Capacity
– Tracks per inch of surface and bits per inch of
track
– Diameter of standard disk size is 14 inch
– Some disk are quite large upto 4 feet in diameter
– Tot no. of bytes stored in disk pack = number of
cylinders* tracks per cylinders * sectors per track*
bytes per sector
• Accessing Time
• Accessing Data
Magnetic Disk
• Example of Capacity of disk pack:
– Let a disk Pack has 10 disk plates each having 200
tracks
– Suppose there are 40 sectors per track and each sector
store 256 bytes
– Since the disk pack has 10 disk plates i.e 18 recording
surface or 18 tracks per cylinder, 200 tracks per plate
means there are 200 cylinders
– Disk Pack Capacity -= number of cylinders* tracks per
cylinders * sectors per track* bytes per sector
– Disk Pack Capacity = 200*18*40*256 = 36864000 bytes
or 36.864 bytes
Magnetic
• Accessing Data:
Disk
– Data is stored on tracks and read from surface by
one or more read/write head
– Two types of disk system moving head and fixed
head
– Moving Head : One read/write head for each
disk surface mounted on an access arm which
can be moved in and out. The head moves
horizontally across the surface of the disk
– Fixed head: The access arm is non movable. A
large number of read/write heads are distributed
over the disk surfaces one head for each track.
No head movement is required and so access
arms are non-movable
Difference between
Magnetic Tape and
Magnetic Disk
Magnetic Disk Magnetic Tape
• Sequential and Direct • Sequential
access storage
• Less Vulnerable to • Less Vulnerable to
damage from dust or damage from dust or
careless handling careless handling
• Access is fast (few • Access is slow
msec) • Data Transfer Rate is
• Data Transfer Rate is low
high
Hard Disks
• Another form of auxiliary storage is a hard disk. A
hard disk consists of one or more rigid metal plates
coated with a metal oxide material that allows data
to be magnetically recorded on the surface of the
platters.
• The hard disk platters spin at a high rate of speed,
typically 5400 to 7200 revolutions per minute (RPM).
• Storage capacities of hard disks for personal
computers range from 10 GB to 120 GB (one billion
bytes are called a gigabyte).

49
sectors
each track is
divided into pie-
shaped wedges

cluster tracks
two or more data is recorded in
sectors concentric circular
combined bands
50
Floppy Disks
A floppy disk is a portable, inexpensive
storage medium that consists of a thin,
circular, flexible plastic disk with a
magnetic coating enclosed in a square-
shaped plastic shell.
Structure Of Floppy Disks
• Initially Floppy disks were 8-inches wide, they then
shrank to 5.25 inches, and today the most widely
used folly disks are 3.5 inches wide and can typically
store 1.44 megabytes of data.
• A folly disk is a magnetic disk, which means that it
used magnetic patterns to store data.
• Data in floppy disks can be read from and written to.
• Formatting is the process of preparing a disk for
reading and writing.
• A track is a narrow recording band that forms a full
circle on the surface of the disk.
• Capacity of Diskette depends on size (diameter) and
type (mode of data recording)

52
Magnetic Drums
• They were used to store
mathematical tables , data or
program segments that were
frequently needed during the
processing operations
• Permanently mounted, cannot be
replaced, low storage capacity are
used seldomly
Mass Storage
• Advantage of both tape and disk technologies
• E is IBM 3850 Mass Storage System that can
store 472 billion characters of data
• Access time is measured in seconds instead
of milliseconds
• Archival Storage
• Cost effective alternative to online magnetic
tape or disk storage
Optical Mass Storage Devices
• Store bit values as variations in light reflection
• Higher areal density & longer data life than magnetic
storage
• Standardized and relatively inexpensive
• Uses: read-only storage with low performance
requirements, applications with high capacity
requirements & where portability in a standardized
format is needed
2.Optical Drives
•CD's (Compact Disk)
~ 700 MB storage
–CD-ROM (read only)
–CD-R: (record) to a CD
–CD-RW: can write and erase CD to reuse it
(re-writable)

•DVD(Digital Video Disk)


Compact Discs (CD)
• A compact disk (CD), also called an optical disc, is a
flat round, portable storage medium that is usually
4.75 inch in diameter.
• A CD-ROM (read only memory), is a compact disc
that used the same laser technology as audio CDs
for recording music. In addition it can contain other
types of data such as text, graphics, and video.
• The capacity of a CD-ROM is 650 MB of data.
DVD (Digital Video Disk)
 DVD-ROM
– Over 4 GB storage (varies with 
format)
– DVD- ROM (read only)
– Many recordable formats (e.g., 
DVD-R, DVD-RW; ..)
– Are more highly compact than 
a CD.
– Special laser is needed to read 
them
Magnetic Bubble Memory
MBM
• Electronic Storage made with solid state electronic chips
• uses a thin film of a magnetic material to hold small
magnetized areas, known as bubbles or domaiins each
of which stores one bit of data
• no moving part
• Used as main memory in microprocessor applications ,
telephone system that redirects improperly dialed
numbers, machine tools , robots and military computers
Storage in Modern
Computers
Alternative Nomenclature
◦ Primary Storage
◦ Secondary Storage
◦ Tertiary Storage
Primary Storage
◦ Cache, Main Memory
Secondary Storage
◦ Flash Memory, Magnetic Disk
Tertiary Storage
◦ Optical Disks, CDs, DVDs, Tape
Memory Hierarchy
CACHE

Price &  MAIN MEMORY Reliability


Speed increases
increases
MAGNETIC DISK

OPTICAL DISK

TAPE

You might also like