SlideShare a Scribd company logo
Memory Hierarchy
Main Memory
Associative Memory
Cache Memory: Cache Mapping techniques
Virtual Memory
Memory Organization
Memory Hierarchy
Memory unit is essential component of digital
computer since it is needed for storing programs and
data.
Memory unit that communicates directly with CPU is
called Main memory.
Devices that provide backup storage is called
auxiliary memory.
Only programs and data currently needed by
processor reside in the main memory.
All other information is stored in auxiliary memory
and transferred to main memory when needed.
Memory hierarchy system consist of all storage
devices from auxiliary memory to main memory to
cache memory
As one goes down the hierarchy :
 Cost per bit decreases.
 Capacity increases.
 Access time increases.
 Frequency of access by the processor decreases.
Main Memory
It is the memory used to store programs and data
during the computer operation.
The principal technology is based on semiconductor
integrated circuits.
It consists of RAM and ROM chips.
RAM chips are available in two form static and
dynamic.
SRAM DRAM
Uses capacitor for storing
information
Uses Flip flop
More cells per unit area due
to smaller cell size.
Needs more space for same
capacity
Cheap and smaller in size Expensive and bigger in size
Slower and analog device Faster and digital device
Requires refresh circuit No need
Used in main memory Used in cache
ROM is uses random access method.
It is used for storing programs that are permanent
and the tables of constants that do not change.
ROM store program called bootstrap loader whose
function is to start the computer software when the
power is turned on.
When the power is turned on, the hardware of the
computer sets the program counter to the first
address of the bootstrap loader.
For the same size chip it is possible to have more bits
of ROM than of RAM, because the internal binary
cells in ROM occupy less space than in RAM,
For this reason the diagram specifies 512 byte ROM
and 128 bytes RAM.
Memory address Map
Designer must specify the size and the type(RAM or
ROM) of memory to be used for particular
application.
The addressing of the memory is then established by
means of table called memory address map that
specifies the memory address assign to each chip.
Let us consider an example in which computer needs
512 bytes of RAM and ROM as well and we have to
use the chips of size 128 bytes for RAM and 512 bytes
for ROM.
Associative Memory
To search particular data in memory, data is read
from certain address and compared if the match is
not found content of the next address is accessed and
compared.
This goes on until required data is found. The
number of access depend on the location of data and
efficiency of searching algorithm.
The searching time can be reduced if data is searched
on the basis of content.
A memory unit accessed by content is called
associative memory or content addressable
memory(CAM)
This type of memory is accessed simultaneously and
in parallel on the basis of data content.
Memory is capable of finding empty unused location
to store the word.
These are used in the application where search time
is very critical and must be very short.
It consists memory array of m words with n bits per
words
Argument register A and key register K have n bits
one for each bit of word.
Match register has m bits, one for each memory
word.
Each word in memory is compared in parallel with
the content of the A register. For the word that
match corresponding bit in the match register is set.
Key register provide the mask for choosing the
particular field in A register.
The entire content of A register is compared if key
register content all 1.
Otherwise only bit that have 1 in key register are
compared.
If the compared data is matched corresponding bits
in the match register are set.
Reading is accomplished by sequential access in
memory for those words whose bit are set.
s
Match Logic
Let us neglect the key register and compare the
content of argument register with memory content.
Word i is equal to argument in A if Aj=Fij for
j=1,2,3,4……..n
The equality of two bits is expressed as
xj =1 if bits are equal and 0 otherwise.
Let us include key register. If Kj=0 then there is no
need to compare Aj and Fij.
Only when Kj=1, comparison is needed.
This achieved by ORing each term with Kj.
Read Operation
If more than one word match with the content, all
the matched words will have 1 in the corresponding
bit position in match register.
Matched words are then read in sequence by
applying a read signal to each word line.
In most application, the associative memory stores a
table with no two identical items under a given key.
Write Operation
If the entire memory is loaded with new information
at once prior to search operation then writing can be
done by addressing each location in sequence.
Tag register contain as many bits as there are words
in memory.
It contain 1 for active word and 0 for inactive word.
If the word is to be inserted, tag register is scanned
until 0 is found and word is written at that position
and bit is change to 1.
Cache Memory
Analysis of large number of program shows that
reference to memory at any given interval of time
tend to be confined to few localized area in memory.
This is known as locality of reference.
If the active portion of program and data are placed
in fast memory, then average execution time of the
program can be reduced. Such fast memory is called
cache memory.
It is placed in between the main memory and the
CPU.
When the CPU need to access the memory it first
search in cache. If word is found, it is read.
If the word is not found, it is read from main
memory and a block of data is transferred from main
memory to cache which contain the current word.
If the word is found in cache, it is said hit. If the
word is not found, it is called miss.
Performance of cache is measured in terms of hit
ratio which ratio of total hit to total memory access
by CPU.
Mapping Techniques
The transformation of data from main memory to
cache is known as mapping process. Three types of
mapping procedures are:
 Associative Mapping
 Direct Mapping
 Set-Associative Mapping
Associative Mapping
Fastest and most flexible cache organization uses
associative memory.
It stores both address and content of memory word.
Address is placed in argument register and memory
is searched for matching address.
If address is found corresponding data is read.
If address is not found, it is read from main memory
and transferred to cache.
If the cache is full, an address- word pair must be
displaced.
Various algorithm are used to determine which pair
to displace. Some of them are FIFO(First In First
Out), LRU(Least Recently Used) etc.
Direct Memory
CPU address is divided into two fields tag and index.
Index field is required to access cache memory and
total address is used to access main memory.
If there are 2^k words in cache and 2^n words in
main memory, then n bit memory address is divided
into two parts. k bits for index field and n-k bits for
tag field.
Direct Mapping Cache Organization
When CPU generates memory request, index field is
used to access the cache.
Tag field of the CPU address is compared with the
tag in the word read. If the tag match, there is hit.
If the tag does not match, word is read from main
memory and updated in cache.
This example use the block size of 1.
The same organization can be implemented for block
size 8.
The index field is divided into two parts: block field
and word field.
In 512 word cache there are 64 blocks of 8 words
each(64*8=512).
Block is specified with 6 bit field and word within
block with 3 bit field.
Every time miss occur, entire block of 8 word is
transferred from main memory to cahche.
Set-Associative Mapping
In direct mapping two words with same index in
their address but different tag values can’t reside
simultaneously in memory.
In this mapping, each data word is stored together
with its tag and number of tag-data items in one
word of the cache is said to form set.
In general, a set associative cache of set size k will
accommodate k words of main memory in each word
of cache.
When a miss occur and the set is full, one of the tag
data item is replaced with new value using various
algorithm.
Writing into Cache
Writing into cache can be done in two ways:
 Write through
 Write Back
In write through, whenever write operation is
performed in cache memory, main memory is also
updated in parallel with the cache.
In write back, only cache is updated and marked by
the flag. When the word is removed from cache, flag
is checked if it is set the corresponding address in
main memory is updated.
Cache Initialization
When power is turned on, cache contain invalid data
indicated by valid bit value 0.
Valid bit of word is set whenever the word is read
from main memory and updated in cache.
If valid bit is 0, new word automatically replace the
invalid data.
Virtual Memory
Virtual memory is a concept used in computer that
permit the user to construct a program as though
large memory space is available equal to auxiliary
memory.
It give the illusion that computer has large memory
even though computer has relatively small main
memory.
It has mechanism that convert generated address
into correct main memory address.
Address Space and Memory Space
An address used by the programmer is called virtual
address and set of such address is called address
space.
An address in main memory is called physical
address. The set of such location is called memory
space.
Address Mapping Using Pages
The main memory is broken down into groups of
equal size called blocks.
Term pages refers to groups of address space of same
size.
Although page and block are of equal size, page refer
to organization of address space and block represent
the organization of memory space.
The term page frame is sometimes used to denote
block.
Page Replacement
The program is executed from main memory until
page required is not available.
If page is not available, this condition is called page
fault. When it occurs, present program is suspended
until the page required is brought into main
memory.
If main memory is full, pages to remove is
determined from the replacement algorithm used.

More Related Content

What's hot

Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Sanjeev Patel
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
Mukta Garg
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
Srikrishna Thota
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
Fraboni Ec
 
Memory Hierarchy.pptx
Memory Hierarchy.pptxMemory Hierarchy.pptx
Memory Hierarchy.pptx
GOLDAtomics
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organizationchidabdu
 
Heap Management
Heap ManagementHeap Management
Heap Management
Jenny Galino
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
Shashank Singh
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
Trinity Dwarka
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)
rishi ram khanal
 
Instruction Level Parallelism (ILP) Limitations
Instruction Level Parallelism (ILP) LimitationsInstruction Level Parallelism (ILP) Limitations
Instruction Level Parallelism (ILP) Limitations
Jose Pinilla
 
80386 Architecture
80386 Architecture80386 Architecture
80386 Architecture
Rohit Choudhury
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
Mukesh Chinta
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Stella526835
 
memory hierarchy
memory hierarchymemory hierarchy
memory hierarchy
sreelakshmikv
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208
Ameer Mehmood
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing ModelAdlin Jeena
 
Programed I/O Modul..
Programed I/O Modul..Programed I/O Modul..
Programed I/O Modul..
Myster Rius
 

What's hot (20)

Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 
Memory Hierarchy.pptx
Memory Hierarchy.pptxMemory Hierarchy.pptx
Memory Hierarchy.pptx
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organization
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
 
Memory hierarchy
Memory hierarchyMemory hierarchy
Memory hierarchy
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)
 
Instruction Level Parallelism (ILP) Limitations
Instruction Level Parallelism (ILP) LimitationsInstruction Level Parallelism (ILP) Limitations
Instruction Level Parallelism (ILP) Limitations
 
80386 Architecture
80386 Architecture80386 Architecture
80386 Architecture
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
memory hierarchy
memory hierarchymemory hierarchy
memory hierarchy
 
Ipc ppt
Ipc pptIpc ppt
Ipc ppt
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing Model
 
Programed I/O Modul..
Programed I/O Modul..Programed I/O Modul..
Programed I/O Modul..
 

Similar to Memory Organization.pdf

Unit 5-lecture-1
Unit 5-lecture-1Unit 5-lecture-1
Unit 5-lecture-1
vishal choudhary
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)
SwapnitaSrivastava1
 
Unit 5-lecture-2
Unit 5-lecture-2Unit 5-lecture-2
Unit 5-lecture-2
vishal choudhary
 
Memory Management
Memory ManagementMemory Management
Memory Management
sangrampatil81
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
AshokRachapalli1
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
COA
COACOA
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
Shashank Asthana
 
lecture-5.pptx
lecture-5.pptxlecture-5.pptx
lecture-5.pptx
sarasaad69
 
computer architecture and organization.pptx
computer architecture and organization.pptxcomputer architecture and organization.pptx
computer architecture and organization.pptx
ROHANSharma311906
 
Cache.pptx
Cache.pptxCache.pptx
Cache.pptx
VCETCSE
 
Bab 4
Bab 4Bab 4
Bab 4
n k
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
kazim Hussain
 
Associative Memory in Computer architecture
Associative Memory in Computer architectureAssociative Memory in Computer architecture
Associative Memory in Computer architecture
pritheeshg03
 
Lec 1 digital electroinics - memory array, write read operations
Lec 1   digital electroinics - memory array, write read operationsLec 1   digital electroinics - memory array, write read operations
Lec 1 digital electroinics - memory array, write read operations
priyankatabhane
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
Arpita Naik
 

Similar to Memory Organization.pdf (20)

Unit 5-lecture-1
Unit 5-lecture-1Unit 5-lecture-1
Unit 5-lecture-1
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)
 
Unit 5-lecture-2
Unit 5-lecture-2Unit 5-lecture-2
Unit 5-lecture-2
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
OSCh9
OSCh9OSCh9
OSCh9
 
COA
COACOA
COA
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
lecture-5.pptx
lecture-5.pptxlecture-5.pptx
lecture-5.pptx
 
computer architecture and organization.pptx
computer architecture and organization.pptxcomputer architecture and organization.pptx
computer architecture and organization.pptx
 
Cache.pptx
Cache.pptxCache.pptx
Cache.pptx
 
Bab 4
Bab 4Bab 4
Bab 4
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Associative Memory in Computer architecture
Associative Memory in Computer architectureAssociative Memory in Computer architecture
Associative Memory in Computer architecture
 
Lec 1 digital electroinics - memory array, write read operations
Lec 1   digital electroinics - memory array, write read operationsLec 1   digital electroinics - memory array, write read operations
Lec 1 digital electroinics - memory array, write read operations
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
Memory+management
Memory+managementMemory+management
Memory+management
 

Recently uploaded

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 

Recently uploaded (20)

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 

Memory Organization.pdf

  • 1. Memory Hierarchy Main Memory Associative Memory Cache Memory: Cache Mapping techniques Virtual Memory Memory Organization
  • 2. Memory Hierarchy Memory unit is essential component of digital computer since it is needed for storing programs and data. Memory unit that communicates directly with CPU is called Main memory. Devices that provide backup storage is called auxiliary memory. Only programs and data currently needed by processor reside in the main memory. All other information is stored in auxiliary memory and transferred to main memory when needed.
  • 3.
  • 4.
  • 5. Memory hierarchy system consist of all storage devices from auxiliary memory to main memory to cache memory As one goes down the hierarchy :  Cost per bit decreases.  Capacity increases.  Access time increases.  Frequency of access by the processor decreases.
  • 6. Main Memory It is the memory used to store programs and data during the computer operation. The principal technology is based on semiconductor integrated circuits. It consists of RAM and ROM chips. RAM chips are available in two form static and dynamic.
  • 7. SRAM DRAM Uses capacitor for storing information Uses Flip flop More cells per unit area due to smaller cell size. Needs more space for same capacity Cheap and smaller in size Expensive and bigger in size Slower and analog device Faster and digital device Requires refresh circuit No need Used in main memory Used in cache
  • 8. ROM is uses random access method. It is used for storing programs that are permanent and the tables of constants that do not change. ROM store program called bootstrap loader whose function is to start the computer software when the power is turned on. When the power is turned on, the hardware of the computer sets the program counter to the first address of the bootstrap loader.
  • 9.
  • 10.
  • 11. For the same size chip it is possible to have more bits of ROM than of RAM, because the internal binary cells in ROM occupy less space than in RAM, For this reason the diagram specifies 512 byte ROM and 128 bytes RAM.
  • 12. Memory address Map Designer must specify the size and the type(RAM or ROM) of memory to be used for particular application. The addressing of the memory is then established by means of table called memory address map that specifies the memory address assign to each chip. Let us consider an example in which computer needs 512 bytes of RAM and ROM as well and we have to use the chips of size 128 bytes for RAM and 512 bytes for ROM.
  • 13.
  • 14.
  • 15. Associative Memory To search particular data in memory, data is read from certain address and compared if the match is not found content of the next address is accessed and compared. This goes on until required data is found. The number of access depend on the location of data and efficiency of searching algorithm. The searching time can be reduced if data is searched on the basis of content.
  • 16. A memory unit accessed by content is called associative memory or content addressable memory(CAM) This type of memory is accessed simultaneously and in parallel on the basis of data content. Memory is capable of finding empty unused location to store the word. These are used in the application where search time is very critical and must be very short.
  • 17.
  • 18. It consists memory array of m words with n bits per words Argument register A and key register K have n bits one for each bit of word. Match register has m bits, one for each memory word. Each word in memory is compared in parallel with the content of the A register. For the word that match corresponding bit in the match register is set.
  • 19. Key register provide the mask for choosing the particular field in A register. The entire content of A register is compared if key register content all 1. Otherwise only bit that have 1 in key register are compared. If the compared data is matched corresponding bits in the match register are set. Reading is accomplished by sequential access in memory for those words whose bit are set.
  • 20.
  • 21. s
  • 22. Match Logic Let us neglect the key register and compare the content of argument register with memory content. Word i is equal to argument in A if Aj=Fij for j=1,2,3,4……..n The equality of two bits is expressed as xj =1 if bits are equal and 0 otherwise.
  • 23.
  • 24. Let us include key register. If Kj=0 then there is no need to compare Aj and Fij. Only when Kj=1, comparison is needed. This achieved by ORing each term with Kj.
  • 25.
  • 26. Read Operation If more than one word match with the content, all the matched words will have 1 in the corresponding bit position in match register. Matched words are then read in sequence by applying a read signal to each word line. In most application, the associative memory stores a table with no two identical items under a given key.
  • 27. Write Operation If the entire memory is loaded with new information at once prior to search operation then writing can be done by addressing each location in sequence. Tag register contain as many bits as there are words in memory. It contain 1 for active word and 0 for inactive word. If the word is to be inserted, tag register is scanned until 0 is found and word is written at that position and bit is change to 1.
  • 28. Cache Memory Analysis of large number of program shows that reference to memory at any given interval of time tend to be confined to few localized area in memory. This is known as locality of reference. If the active portion of program and data are placed in fast memory, then average execution time of the program can be reduced. Such fast memory is called cache memory. It is placed in between the main memory and the CPU.
  • 29.
  • 30. When the CPU need to access the memory it first search in cache. If word is found, it is read. If the word is not found, it is read from main memory and a block of data is transferred from main memory to cache which contain the current word. If the word is found in cache, it is said hit. If the word is not found, it is called miss. Performance of cache is measured in terms of hit ratio which ratio of total hit to total memory access by CPU.
  • 31. Mapping Techniques The transformation of data from main memory to cache is known as mapping process. Three types of mapping procedures are:  Associative Mapping  Direct Mapping  Set-Associative Mapping
  • 32. Associative Mapping Fastest and most flexible cache organization uses associative memory. It stores both address and content of memory word. Address is placed in argument register and memory is searched for matching address. If address is found corresponding data is read. If address is not found, it is read from main memory and transferred to cache.
  • 33. If the cache is full, an address- word pair must be displaced. Various algorithm are used to determine which pair to displace. Some of them are FIFO(First In First Out), LRU(Least Recently Used) etc.
  • 34. Direct Memory CPU address is divided into two fields tag and index. Index field is required to access cache memory and total address is used to access main memory. If there are 2^k words in cache and 2^n words in main memory, then n bit memory address is divided into two parts. k bits for index field and n-k bits for tag field.
  • 35.
  • 36. Direct Mapping Cache Organization
  • 37. When CPU generates memory request, index field is used to access the cache. Tag field of the CPU address is compared with the tag in the word read. If the tag match, there is hit. If the tag does not match, word is read from main memory and updated in cache. This example use the block size of 1. The same organization can be implemented for block size 8.
  • 38. The index field is divided into two parts: block field and word field. In 512 word cache there are 64 blocks of 8 words each(64*8=512). Block is specified with 6 bit field and word within block with 3 bit field. Every time miss occur, entire block of 8 word is transferred from main memory to cahche.
  • 39.
  • 40. Set-Associative Mapping In direct mapping two words with same index in their address but different tag values can’t reside simultaneously in memory. In this mapping, each data word is stored together with its tag and number of tag-data items in one word of the cache is said to form set. In general, a set associative cache of set size k will accommodate k words of main memory in each word of cache.
  • 41.
  • 42. When a miss occur and the set is full, one of the tag data item is replaced with new value using various algorithm.
  • 43. Writing into Cache Writing into cache can be done in two ways:  Write through  Write Back In write through, whenever write operation is performed in cache memory, main memory is also updated in parallel with the cache. In write back, only cache is updated and marked by the flag. When the word is removed from cache, flag is checked if it is set the corresponding address in main memory is updated.
  • 44. Cache Initialization When power is turned on, cache contain invalid data indicated by valid bit value 0. Valid bit of word is set whenever the word is read from main memory and updated in cache. If valid bit is 0, new word automatically replace the invalid data.
  • 45. Virtual Memory Virtual memory is a concept used in computer that permit the user to construct a program as though large memory space is available equal to auxiliary memory. It give the illusion that computer has large memory even though computer has relatively small main memory. It has mechanism that convert generated address into correct main memory address.
  • 46. Address Space and Memory Space An address used by the programmer is called virtual address and set of such address is called address space. An address in main memory is called physical address. The set of such location is called memory space.
  • 47.
  • 48.
  • 49. Address Mapping Using Pages The main memory is broken down into groups of equal size called blocks. Term pages refers to groups of address space of same size. Although page and block are of equal size, page refer to organization of address space and block represent the organization of memory space. The term page frame is sometimes used to denote block.
  • 50.
  • 51.
  • 52.
  • 53. Page Replacement The program is executed from main memory until page required is not available. If page is not available, this condition is called page fault. When it occurs, present program is suspended until the page required is brought into main memory. If main memory is full, pages to remove is determined from the replacement algorithm used.