Date post: | 10-Apr-2018 |
Category: |
Documents |
Upload: | pawan-kumar |
View: | 214 times |
Download: | 0 times |
of 61
8/8/2019 Lecture 04Memory Management Consise
1/61
Memory Management
By
Varsha Kapoor
8/8/2019 Lecture 04Memory Management Consise
2/61
Objectives Basic fundamentals related to primary memory andsecondary 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
8/8/2019 Lecture 04Memory Management Consise
3/61
Units of MeasurementSpatial units:o byte: 8 bitso kilobyte (KB): 1024 or 2 10 byteso megabyte (MB): 1024 kilobytes or 2 20 byteso gigabyte (GB): 1024 megabytes or 2 30 bytes
Time units:o nanosecond (ns) one- billionth (10 -9 ) of a secondo microsecond ( s) one- millionth (10 -6 ) of a secondo millisecond (ms) one- thousandth (10 -3 ) of a second
8/8/2019 Lecture 04Memory Management Consise
4/61
Storage unit Criteria
Access Time (fast) Storage Capacity (large)
Cost per bit of storage (low)
8/8/2019 Lecture 04Memory Management Consise
5/61
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 datawhen a process is not executing
8/8/2019 Lecture 04Memory Management Consise
6/61
1. Primary Storage
Primary Storage of a computer , also calledas its main memory, is used to hold theprogram instructions & data, intermediateresult of processing , & recently produced
results on which the computer is currentlyworking. These piece of information are represented
electronically in the main memory chips &
while it remains in the main memory , cpu canaccess it directly at a very fast speed.However , primary storage can holdinformation only while computer system is on.
8/8/2019 Lecture 04Memory Management Consise
7/61
As soon as the computer system switchesoff or resets, the information held in primary
memory is erased. Moreover , primary storage normally haslimited storage capacity because it is veryexpensive.
8/8/2019 Lecture 04Memory Management Consise
8/61
Storage Location andAddress
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 theaddress of the cell and it is used to identify the cells.
A given memory is divided into N words , where N generallyis some power of 2. Each word has a number or address assign to itself. Each word can store either a data item or aninstruction
The address starts at 0 and goes up to (N-1). the memory islike a large cabinet containing as many drawers as there areaddresses on memory. Each drawer contains a word and theaddress is written on outside of the drawer.
8/8/2019 Lecture 04Memory Management Consise
9/61
orage oca on an ress(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 bitscalled word length .
Each cell has a unique number assigned to it calledthe address of the cell and it is used to identify thecells.
A given memory is divided into N words , where Ngenerally is some power of 2. Each word has anumber 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 manydrawers as there are addresses on memory. Each
drawer contains a word and the address is written onoutside of the drawer.
8/8/2019 Lecture 04Memory Management Consise
10/61
Organization of a Primary StorageUnit having N- words
0
1
2
3
4
5
N-2
N-1 =====
Bit1 Bit 2
A d d r e s s e s
The words of a
primary StorageUnit
Each wordcontains the samenumber of bits = word lengt
}
8/8/2019 Lecture 04Memory Management Consise
11/61
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 locationstoring 16 bits is called a 16 bit 4096 wordmemory or 4K 16 bit memory.
If the word size is 8 bits then it becomesimmaterial whether the memory capacity isexpressed in bytes or words.
More bits per word more rapid flow of elctronicsignals and faster computers
8/8/2019 Lecture 04Memory Management Consise
12/61
Fixed and Variable word lengthStorage
0501 B O M B A Y
0502 D E L H I
0503
1024
0025B
0026O
0027M
0028B
0029A
0030Y
0031
||
||||
||
||
4096
0051D
0052E
0053L
0054H
0055I
0056
4096
AddressNumber
8/8/2019 Lecture 04Memory Management Consise
13/61
Difference Between variable andFixed Word Length
Fixed storage space may be
wasted computers have faster
calculating speeds . Theycan add two data words ina single operation
Used in larger mainframecomputers , super-computers like the CRAY-1
Variable make the most efficient
use of available storagespace
Slower . only one digit(byte) in each number canbe added during a singlemachine operation. Thus,eight steps are required tocomplete the calculation
Used in microcomputersMost of todays business and scientific processing is handled byMost of todays business and scientific processing is handled byflexible computers (in terms of the instruction set) which canflexible computers (in terms of the instruction set) which canemploy either fixed or variable word length.employ either fixed or variable word length.
8/8/2019 Lecture 04Memory Management Consise
14/61
Memory Hierarchy
Magnetic Tape
Magnetic Disk
Main Memory (RAM)
CacheFast, Small,
Experience
Slow,
Large, Cheap
8/8/2019 Lecture 04Memory Management Consise
15/61
Memory Hierarchy At the primary storage level , the memory
hierarchy giabytes of data in DRA, in somecases, entire databases can be kept in themain memory (with a backup copy onmagnetic disk), leading to main memory
databases . includes, at the most expensiveend cache memory , which is a static RAM (Random Access Memory).
The next level of primary storage is DRAM
(Dynamic RAM), The advantage of DRAM isits low cost, lower speed compared withstatic RAM.
Programs normally reside and execute in
DRAM.
8/8/2019 Lecture 04Memory Management Consise
16/61
Primary Memory
RAM Large memory, which is fast butnot as fast as internal processorregister.
Processor directly accesses thismemory.
It is mainly based on integratedcircuit.
Read/Write Memory
8/8/2019 Lecture 04Memory Management Consise
17/61
Types of RAM1. Static RAM (SRAM):
Doesnt 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 smallbattery
8/8/2019 Lecture 04Memory Management Consise
18/61
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
8/8/2019 Lecture 04Memory Management Consise
19/61
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
Types of RAM
8/8/2019 Lecture 04Memory Management Consise
20/61
The operation of cache memory
1. Cache fetches datafrom next to currentaddresses in mainmemory
2. CPU checks to seewhether the nextinstruction it requires is incache
3. If it is, then theinstruction is fetchedfrom the cache a veryfast position
4. If not, the CPU has to
fetch next instructionfrom main memory - amuch slower process
Main
Memory(DRAM)
CPU
Cache
Memory
(SRAM)
= Bus connections
8/8/2019 Lecture 04Memory Management Consise
21/61
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 systems 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 programsand 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 inmilliseconds (Note: a millisecond is a thousandth of a second)
Virtual memory is much slower than RAM
8/8/2019 Lecture 04Memory Management Consise
22/61
Microprograms Special programs written to perform thecomplicated 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 computersystems
ROMs are used by computer manufacturersfor storing Microprograms so that theycould be modified by the users
8/8/2019 Lecture 04Memory Management Consise
23/61
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
f
8/8/2019 Lecture 04Memory Management Consise
24/61
Types of ROMROM 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 OnlyMemory.
the information is stored by programmersafter its manufacturing.
cannot be altered or erased later on.
f
8/8/2019 Lecture 04Memory Management Consise
25/61
Types of ROMROM available for microcomputers
EPROM: EPROM stands for Erasable ProgrammableRead Only Memory.
It is similar to PROM, but its information canbe 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.
T f ROM
8/8/2019 Lecture 04Memory Management Consise
26/61
Types of ROMROM available for microcomputers EAPROM:
EAPROM stands for Electrically Alterable Read OnlyMemory. 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
8/8/2019 Lecture 04Memory Management Consise
27/61
Memory Hierarchy-flash memory Flash memory, since 1988 it has become
common, particularly because it isnonvolatile, using EEPROM (ElectricallyErasable Programmable Read-OnlyMemory) technology. Its life is 10,000-1,000,000 times erase Read/write isfast, but erase is slow
Therefore special arrangements aremade for the file system, regarding filedelete or update.
Capacities up to 128 GB has beenrealized todate.
T f ROM
8/8/2019 Lecture 04Memory Management Consise
28/61
Types of ROMROM available for microcomputers
ROM cartridges Similar to EEPROM Commonly used in games machines
Prevents software from being easily copied
8/8/2019 Lecture 04Memory Management Consise
29/61
Memory configurations for Intel CPUs
8/8/2019 Lecture 04Memory Management Consise
30/61
Registers
Internal Processor memories Not a part of RAM
High speed temporary memorylocations Length of the register denotes the
number of bits it can store
8/8/2019 Lecture 04Memory Management Consise
31/61
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:
8/8/2019 Lecture 04Memory Management Consise
32/61
Secondary Storage. Secondary storage of a computer also know as
auxiliary storage or Backup storage, is used totake care of the limitation of Primary Storage.
That is , it supplements the limited storagecapacity, Cost per bit of storage & the volatilecharacteristic of primary storage.
This is because secondary storage is muchcheaper than primary storage & it can retain theinformation even when a computer systemswitches off.
Magnetic disk is the most commonly usedsecondary storage medium.
8/8/2019 Lecture 04Memory Management Consise
33/61
Access MethodsTwo 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 DisksCD-ROM = (Compact disc, read-only memory
8/8/2019 Lecture 04Memory Management Consise
34/61
34
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)
8/8/2019 Lecture 04Memory Management Consise
35/61
Punched Paper Tape
Disadvantages:No of characters stored in the given space is lessPaper tape media is easily torn and mutilatedCost per bit stored is very low
8/8/2019 Lecture 04Memory Management Consise
36/61
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
8/8/2019 Lecture 04Memory Management Consise
37/61
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 CPUor it can write the information beingproduced by computer into a tape
8/8/2019 Lecture 04Memory Management Consise
38/61
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
8/8/2019 Lecture 04Memory Management Consise
39/61
Parity or Check bit A parity bit is a bit that is added toensure that the number of bits with
the value one in a set of bits is even
or odd. Parity bits are used as the simplestform of error detecting code.7 bits of data 8 bitsincluding parity
(number of 1s)
Even Odd
0 0000000 0 0000000 1 0000000
1010001 (3) 11010001 0 1010001
1101001 (4) 0 1101001 11101001 1111111 (7) 11111111 0 1111111
8/8/2019 Lecture 04Memory Management Consise
40/61
Advantages of Magnetic Tapes
Unlimited Storage High Data Density
Low Cost Rapid Transfer Rate Ease of handling
Portability
8/8/2019 Lecture 04Memory Management Consise
41/61
Limitations of Magnetic Tapes
No Direct access Indirect Interpretation
Environment Problems
8/8/2019 Lecture 04Memory Management Consise
42/61
Magnetic Storage Exploits duality of magnetism andelectricity Converts electrical signals into magnetic
charges Captures magnetic charge on a storage
medium
Later regenerates electrical current fromstored magnetic charge
Polarity of magnetic charge representsbit values zero and one
8/8/2019 Lecture 04Memory Management Consise
43/61
1. Magnetic Drives
8/8/2019 Lecture 04Memory Management Consise
44/61
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 acentral shaft which rotates at speed of 2400 or more rpm
Random access device; read/write head can be moved toany location on the platter
Hard disks and floppy disks Cost performance leader forgeneral-purpose on-line secondary storage
8/8/2019 Lecture 04Memory Management Consise
45/61
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
8/8/2019 Lecture 04Memory Management Consise
46/61
8/8/2019 Lecture 04Memory Management Consise
47/61
Magnetic Disk Accessing Data: Data is stored on tracks and read from surface byone or more read/write head Two types of disk system moving head and fixed
head
Moving Head : One read/write head for eachdisk surface mounted on an access arm whichcan be moved in and out. The head moveshorizontally across the surface of the disk
Fixed head: The access arm is non movable. Alarge number of read/write heads are distributedover the disk surfaces one head for each track.No head movement is required and so access
arms are non-movable
erence etween
8/8/2019 Lecture 04Memory Management Consise
48/61
erence etweenMagnetic Tape and
Magnetic DiskMagnetic Disk Sequential and Direct
access storage
Less Vulnerable todamage from dust orcareless handling
Access is fast (few
msec) Data Transfer Rate ishigh
Magnetic Tape Sequential
Less Vulnerable todamage from dust orcareless handling
Access is slow
Data Transfer Rate islow
8/8/2019 Lecture 04Memory Management Consise
49/61
8/8/2019 Lecture 04Memory Management Consise
50/61
50
sectorseach track isdivided into pie-shaped wedges
clustertwo or moresectorscombined
tracksdata is recorded inconcentric circularbands
8/8/2019 Lecture 04Memory Management Consise
51/61
8/8/2019 Lecture 04Memory Management Consise
52/61
52
Structure Of Floppy Disks Initially Floppy disks were 8-inches wide, they then
shrank to 5.25 inches, and today the most widelyused folly disks are 3.5 inches wide and can typicallystore 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 fullcircle on the surface of the disk. Capacity of Diskette depends on size (diameter) and
type (mode of data recording)
8/8/2019 Lecture 04Memory Management Consise
53/61
Magnetic Drums
They were used to storemathematical tables , data orprogram segments that werefrequently needed during theprocessing operations
Permanently mounted, cannot bereplaced, low storage capacity areused seldomly
8/8/2019 Lecture 04Memory Management Consise
54/61
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 insteadof milliseconds Archival Storage Cost effective alternative to online magnetic
tape or disk storage
8/8/2019 Lecture 04Memory Management Consise
55/61
8/8/2019 Lecture 04Memory Management Consise
56/61
2.Optical DrivesCD's (Compact Disk)
~ 700 MB storage CD-ROM (read only) CD-R: ( r ecord) to a CD CD-RW: can write and erase CD to reuse it
(r e- w ritable)
DVD(Digital Video Disk)
8/8/2019 Lecture 04Memory Management Consise
57/61
Compact Discs (CD) A compact disk (CD), also called an optical disc, is a
flat round, portable storage medium that is usually4.75 inch in diameter.
A CD-ROM (read only memory), is a compact discthat used the same laser technology as audio CDsfor recording music. In addition it can contain othertypes of data such as text, graphics, and video.
The capacity of a CD-ROM is 650 MB of data.
8/8/2019 Lecture 04Memory Management Consise
58/61
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
DVD (Digital Video Disk)
M ti B bbl M
8/8/2019 Lecture 04Memory Management Consise
59/61
Magnetic Bubble MemoryMBM
Electronic Storage made with solid state electronic chips
uses a thin film of a magnetic material to hold smallmagnetized areas, known as bubbles or domaiins eachof which stores one bit of data
no moving part Used as main memory in microprocessor applications ,
telephone system that redirects improperly dialednumbers, machine tools , robots and military computers
St g i M d
8/8/2019 Lecture 04Memory Management Consise
60/61
Storage in ModernComputers
Alternative Nomenclature Primary Storage Secondary Storage Tertiary StoragePrimary Storage
Cache, Main MemorySecondary Storage
Flash Memory, Magnetic Disk Tertiary Storage Optical Disks, CDs, DVDs, Tape
8/8/2019 Lecture 04Memory Management Consise
61/61
Memory Hierarchy
CACHE
MAIN MEMORY
MAGNETIC DISK
TAPE
OPTICAL DISK
Price &
Speedincreases
Reliabilityincreases