SlideShare a Scribd company logo
DISCOVER . LEARN . EMPOWER
MEMORY ORGANIZATION
University Institute of Engineering
DEPARTMENT OF COMPUTER SCIENCE
& ENGINEERING
Bachelor of Engineering (Computer Science & Engineering)
Subject Name: Computer Organization & Architecture
Subject Code: CST-252
Topics covered
• Memory hierarchy
• Cache Memory Associative Memory
• Cache memory with associative memory
• Virtual Memory:
1. Paging
2. Segmentation
2
MEMORY HIERARCHY
3
• Memory Hierarchy is to obtain the highest possible access speed while minimizing the total cost of the
memory system
MAIN MEMORY
• Typical RAM chips
• Typical ROM chips
4
Chip select 1
Chip select 2
Read
Write
7-bit address
CS1
CS2
RD
WR
AD 7
128 x 8
RAM
8-bit data bus
CS1 CS2 RD WR
0 0 x x
0 1 x x
1 0 0 0
1 0 0 1
1 0 1 x
1 1 x x
Memory function
Inhibit
Inhibit
Inhibit
Write
Read
Inhibit
State of data bus
High-impedence
High-impedence
High-impedence
Input data to RAM
Output data from RAM
High-impedence
Chip select 1
Chip select 2
9-bit address
CS1
CS2
AD 9
512 x 8
ROM
8-bit data bus
• Address space assignment to each memory chip
• Example: 512 bytes RAM and 512 bytes ROM
• RAM and ROM chips are connected to a CPU through the data and address buses
• - The low-order lines in the address bus select the byte within the chips and other lines in the address bus
select a particular chip through its chip select inputs
5
MEMORY ADDRESS MAP
RAM 1
RAM 2
RAM 3
RAM 4
ROM
0000 - 007F
0080 - 00FF
0100 - 017F
0180 - 01FF
0200 - 03FF
Component
Hexa
address
0 0 0 x x x x x x x
0 0 1 x x x x x x x
0 1 0 x x x x x x x
0 1 1 x x x x x x x
1 x x x x x x x x x
10 9 8 7 6 5 4 3 2 1
Address bus
6
MEMORY HIERACHY
• Provide backupstorage
• MAGNETIC DISKS,MAGNETIC
TAPES
Auxiliary
Memory
• Occupiescentral position,
communicatesdirectly with theCPU,
Auxiliary Memory,CacheMemory
Main
Memory
CPU
• Special high speedmemory
• Currentprogramsanddata to
CPUat rapidrate
Cache
Memory
I/O
Processor
• CPU logic is usually faster than main memory access time, with the result that processing speed is limited
primarily by the speed of main memory.
• The cache is used for storing segments of programs currently being executed in the CPU and temporary data
frequently needed in the present calculations.
• The typical access time ratio between cache and main memory is about 1 to 7~10 .
• Auxiliary memory access time is usually 1000 times that of main memory.
• The memory hierarchy system consists of all storage devices employed in acomputer system from the slow by high-
capacity auxiliary memory to arelatively faster main memory,to anevensmallerandfastercachememory.
7
Contd..
• Amemoryunitaccessedbycontentsiscalled anassociativememory or content addressablememory(CAM).
• Thistype of memory isaccessed simultaneously andin parallel on the basisof data content rather than by specificaddress or
location.
Writeoperation:
•Whenaword iswritten ininanassociativememory, no addressisgiven
•Thememoryiscapableof finding anunusedlocation tostore the word.
Readoperation:
•When a word is to be read from an associative memory, the contents of the word, or a part of the word is specified.
•The memory locates all the words which match the specified content and marks them for reading.
8
ASSOCIATIVE MEMORY
HARDWARE ORGANIZATION
• Argument register(A): It contains the word to be searched.
It hasn bits(onefor eachbit of the word).
• Key Register(K): It provides mask for choosing a particular
field or key in the argument word. It also hasn bits.
• Associative memory array: It contains the words which are
to be comparedwith the argument word.
• Match Register(M):It has m bits, one bit corresponding to
each word in the memory array . After the matching process, the
bits corresponding to matching words in match register are set
to 1.
9
SOURCE: Computer architecture by Morris Mano
• The transformation of data from main memory to cache memory is referred to as a mapping process, there are three
types ofmapping:
• Associativemapping
• Directmapping
• Set-associativemapping
• T
ohelpunderstandthe mappingprocedure,wehavethe followingexample:
10
MAPPING PROCESS
SOURCE: Computer architecture by Morris Mano
ASSOCIATIVE MAPPING
11
SOURCE: Computer architecture by Morris Mano
• The fastest and most flexible cache organization uses an associative
memory.
• The associative memory stores both the address and data of the
memory word.
• This permits any location in cache to store a word from main
memory.
• The address value of 15 bits is shown as a five-digit octal number
and its corresponding 12-bit word is shown as a four-digit octal
number
• Associativememoryis expensivecomparedto RAM.
• In general case, there are 2^k words in cache memory and 2^n words in
mainmemory(inour case,k=9,n=15).
• Thenbitmemoryaddress isdividedintotwofields: k-bitsfortheindexand
• n-kbitsforthetagfield.
12
DIRECT MAPPING
SOURCE: Computer architecture by Morris Mano
• The disadvantage of direct mapping is that two words with the same index in their address but with different tag values
cannotresideincachememory atthesametime.
• Set-Associative Mappingisan improvementoverthedirect- mappinginthateachwordof cachecanstoretwoormore word
ofmemoryunderthe sameindexaddress.
13
SET ASSOCIATIVE MAPPING
SOURCE: Computer architecture by Morris Mano
• Optimalreplacementalgorithm–findthe blockforreplacementthathasminimum chancetobereferencednexttime.
• Twoalgorithms:
I. FIFO:Selectstheitemwhichhasbeeninthesetthe longest.
II. LRU:Selectstheitemwhichhasbeenleastrecentlyused bytheCPU.
14
REPLACEMENT ALGORITHMS
• Virtualmemoryisacommonpartof operatingsystemondesktopcomputers.
• ThetermVirtualMemoryreferstosomething whichappearstobepresentbutactuallyis not.
• Thistechniqueallowsuserstousemore memoryforaprogramthantherealmemory ofacomputer.
15
VIRTUAL MEMORY
• Virtual Memoryisaimaginarymemory which weassumeor use,when we haveamaterial that exceedsourmemoryat that
time.
• Virtual Memory is temporary memory which is used along with the ram of the system.
16
NEED FOR VIRTUAL MEMORY
• Allows Processes whose aggregate memory requirement is greater than the amount of physical memory, as infrequently
usedpages canresideonthedisk.
• Virtualmemoryallowsspeedgainwhenonlya particularsegmentoftheprogramisrequired fortheexecutionoftheprogram.
• Thisconceptisveryhelpfulinimplementing multiprogrammingenvironment.
17
ADVANTAGES
• Applicationsrunratherslowerwhentheyare usingvirtualmemory.
• Ittakesmoretimetoswitchbetween applications.
• Reducessystemstability.
18
DISADVANTAGES
APPLICATIONS
• Computer organization and architecture course deals with instruction set architecture, micro architecture and
efficient implementation of micro architecture.
• Understanding the computer architecture concepts is essential for students interested in hardware, processor
design, compilers, and operating systems.
19
REFERENCES
Reference Books:
1. J.P. Hayes, “Computer Architecture and Organization”, Third Edition.
2. Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall.
3. Stallings, W., “Computer Organization and Architecture”, Eighth Edition, Pearson Education.
Text Books:
1. Carpinelli J.D,” Computer systems organization &Architecture”, Fourth Edition, Addison Wesley.
2. Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon Kauffman.
Reference Website
1. https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/
20
Assessment Pattern
• Element1(Assignment 1,2,3(Average)): 12 Marks
• Element2(Surprise Test): 9 Marks
• Element3(Tutorial/Optional): 9 Marks
• Element4(Quiz): 12 Marks
• MST1: 36 Marks
• MST2: 36 Marks
• Final Examination: 60 Marks
21
THANK YOU

More Related Content

Similar to Memory organization.pptx

CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
Asst.prof M.Gokilavani
 
Cache simulator
Cache simulatorCache simulator
Cache simulator
Suraj Saini
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
VISHAL DONGA
 
Memory organization
Memory organizationMemory organization
Memory organization
ishapadhy
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
Sandeep Kaur Goraya
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisation
RamjiChaurasiya
 
Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithms
Sabidur Rahman
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)
SwapnitaSrivastava1
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryAshik Iqbal
 
Memory hierarchy.pdf
Memory hierarchy.pdfMemory hierarchy.pdf
Memory hierarchy.pdf
ISHAN194169
 
Memory Hierarchy PPT of Computer Organization
Memory Hierarchy PPT of Computer OrganizationMemory Hierarchy PPT of Computer Organization
Memory Hierarchy PPT of Computer Organization
2022002857mbit
 
Cache memory
Cache memoryCache memory
Cache memoryAnuj Modi
 
Computer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary MemoryComputer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary Memory
Budditha Hettige
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
Mohd Tariq
 
Computer Architecture and organization
Computer Architecture and organizationComputer Architecture and organization
Computer Architecture and organizationBadrinath Kadam
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf
arpowersarps
 
Massively Parallel Architectures
Massively Parallel ArchitecturesMassively Parallel Architectures
Massively Parallel Architectures
Jason Hearne-McGuiness
 

Similar to Memory organization.pptx (20)

CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
 
Cache simulator
Cache simulatorCache simulator
Cache simulator
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisation
 
Coa presentation3
Coa presentation3Coa presentation3
Coa presentation3
 
Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithms
 
Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)Computer Organisation and Architecture (COA)
Computer Organisation and Architecture (COA)
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache Memory
 
Cache
CacheCache
Cache
 
Memory hierarchy.pdf
Memory hierarchy.pdfMemory hierarchy.pdf
Memory hierarchy.pdf
 
Lecture2
Lecture2Lecture2
Lecture2
 
Memory Hierarchy PPT of Computer Organization
Memory Hierarchy PPT of Computer OrganizationMemory Hierarchy PPT of Computer Organization
Memory Hierarchy PPT of Computer Organization
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary MemoryComputer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary Memory
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
 
Computer Architecture and organization
Computer Architecture and organizationComputer Architecture and organization
Computer Architecture and organization
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf
 
Massively Parallel Architectures
Massively Parallel ArchitecturesMassively Parallel Architectures
Massively Parallel Architectures
 

Recently uploaded

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
 
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
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
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
 
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
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
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
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 

Recently uploaded (20)

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
 
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
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
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
 
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
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
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
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 

Memory organization.pptx

  • 1. DISCOVER . LEARN . EMPOWER MEMORY ORGANIZATION University Institute of Engineering DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Bachelor of Engineering (Computer Science & Engineering) Subject Name: Computer Organization & Architecture Subject Code: CST-252
  • 2. Topics covered • Memory hierarchy • Cache Memory Associative Memory • Cache memory with associative memory • Virtual Memory: 1. Paging 2. Segmentation 2
  • 3. MEMORY HIERARCHY 3 • Memory Hierarchy is to obtain the highest possible access speed while minimizing the total cost of the memory system
  • 4. MAIN MEMORY • Typical RAM chips • Typical ROM chips 4 Chip select 1 Chip select 2 Read Write 7-bit address CS1 CS2 RD WR AD 7 128 x 8 RAM 8-bit data bus CS1 CS2 RD WR 0 0 x x 0 1 x x 1 0 0 0 1 0 0 1 1 0 1 x 1 1 x x Memory function Inhibit Inhibit Inhibit Write Read Inhibit State of data bus High-impedence High-impedence High-impedence Input data to RAM Output data from RAM High-impedence Chip select 1 Chip select 2 9-bit address CS1 CS2 AD 9 512 x 8 ROM 8-bit data bus
  • 5. • Address space assignment to each memory chip • Example: 512 bytes RAM and 512 bytes ROM • RAM and ROM chips are connected to a CPU through the data and address buses • - The low-order lines in the address bus select the byte within the chips and other lines in the address bus select a particular chip through its chip select inputs 5 MEMORY ADDRESS MAP RAM 1 RAM 2 RAM 3 RAM 4 ROM 0000 - 007F 0080 - 00FF 0100 - 017F 0180 - 01FF 0200 - 03FF Component Hexa address 0 0 0 x x x x x x x 0 0 1 x x x x x x x 0 1 0 x x x x x x x 0 1 1 x x x x x x x 1 x x x x x x x x x 10 9 8 7 6 5 4 3 2 1 Address bus
  • 6. 6 MEMORY HIERACHY • Provide backupstorage • MAGNETIC DISKS,MAGNETIC TAPES Auxiliary Memory • Occupiescentral position, communicatesdirectly with theCPU, Auxiliary Memory,CacheMemory Main Memory CPU • Special high speedmemory • Currentprogramsanddata to CPUat rapidrate Cache Memory I/O Processor
  • 7. • CPU logic is usually faster than main memory access time, with the result that processing speed is limited primarily by the speed of main memory. • The cache is used for storing segments of programs currently being executed in the CPU and temporary data frequently needed in the present calculations. • The typical access time ratio between cache and main memory is about 1 to 7~10 . • Auxiliary memory access time is usually 1000 times that of main memory. • The memory hierarchy system consists of all storage devices employed in acomputer system from the slow by high- capacity auxiliary memory to arelatively faster main memory,to anevensmallerandfastercachememory. 7 Contd..
  • 8. • Amemoryunitaccessedbycontentsiscalled anassociativememory or content addressablememory(CAM). • Thistype of memory isaccessed simultaneously andin parallel on the basisof data content rather than by specificaddress or location. Writeoperation: •Whenaword iswritten ininanassociativememory, no addressisgiven •Thememoryiscapableof finding anunusedlocation tostore the word. Readoperation: •When a word is to be read from an associative memory, the contents of the word, or a part of the word is specified. •The memory locates all the words which match the specified content and marks them for reading. 8 ASSOCIATIVE MEMORY
  • 9. HARDWARE ORGANIZATION • Argument register(A): It contains the word to be searched. It hasn bits(onefor eachbit of the word). • Key Register(K): It provides mask for choosing a particular field or key in the argument word. It also hasn bits. • Associative memory array: It contains the words which are to be comparedwith the argument word. • Match Register(M):It has m bits, one bit corresponding to each word in the memory array . After the matching process, the bits corresponding to matching words in match register are set to 1. 9 SOURCE: Computer architecture by Morris Mano
  • 10. • The transformation of data from main memory to cache memory is referred to as a mapping process, there are three types ofmapping: • Associativemapping • Directmapping • Set-associativemapping • T ohelpunderstandthe mappingprocedure,wehavethe followingexample: 10 MAPPING PROCESS SOURCE: Computer architecture by Morris Mano
  • 11. ASSOCIATIVE MAPPING 11 SOURCE: Computer architecture by Morris Mano • The fastest and most flexible cache organization uses an associative memory. • The associative memory stores both the address and data of the memory word. • This permits any location in cache to store a word from main memory. • The address value of 15 bits is shown as a five-digit octal number and its corresponding 12-bit word is shown as a four-digit octal number
  • 12. • Associativememoryis expensivecomparedto RAM. • In general case, there are 2^k words in cache memory and 2^n words in mainmemory(inour case,k=9,n=15). • Thenbitmemoryaddress isdividedintotwofields: k-bitsfortheindexand • n-kbitsforthetagfield. 12 DIRECT MAPPING SOURCE: Computer architecture by Morris Mano
  • 13. • The disadvantage of direct mapping is that two words with the same index in their address but with different tag values cannotresideincachememory atthesametime. • Set-Associative Mappingisan improvementoverthedirect- mappinginthateachwordof cachecanstoretwoormore word ofmemoryunderthe sameindexaddress. 13 SET ASSOCIATIVE MAPPING SOURCE: Computer architecture by Morris Mano
  • 14. • Optimalreplacementalgorithm–findthe blockforreplacementthathasminimum chancetobereferencednexttime. • Twoalgorithms: I. FIFO:Selectstheitemwhichhasbeeninthesetthe longest. II. LRU:Selectstheitemwhichhasbeenleastrecentlyused bytheCPU. 14 REPLACEMENT ALGORITHMS
  • 15. • Virtualmemoryisacommonpartof operatingsystemondesktopcomputers. • ThetermVirtualMemoryreferstosomething whichappearstobepresentbutactuallyis not. • Thistechniqueallowsuserstousemore memoryforaprogramthantherealmemory ofacomputer. 15 VIRTUAL MEMORY
  • 16. • Virtual Memoryisaimaginarymemory which weassumeor use,when we haveamaterial that exceedsourmemoryat that time. • Virtual Memory is temporary memory which is used along with the ram of the system. 16 NEED FOR VIRTUAL MEMORY
  • 17. • Allows Processes whose aggregate memory requirement is greater than the amount of physical memory, as infrequently usedpages canresideonthedisk. • Virtualmemoryallowsspeedgainwhenonlya particularsegmentoftheprogramisrequired fortheexecutionoftheprogram. • Thisconceptisveryhelpfulinimplementing multiprogrammingenvironment. 17 ADVANTAGES
  • 18. • Applicationsrunratherslowerwhentheyare usingvirtualmemory. • Ittakesmoretimetoswitchbetween applications. • Reducessystemstability. 18 DISADVANTAGES
  • 19. APPLICATIONS • Computer organization and architecture course deals with instruction set architecture, micro architecture and efficient implementation of micro architecture. • Understanding the computer architecture concepts is essential for students interested in hardware, processor design, compilers, and operating systems. 19
  • 20. REFERENCES Reference Books: 1. J.P. Hayes, “Computer Architecture and Organization”, Third Edition. 2. Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall. 3. Stallings, W., “Computer Organization and Architecture”, Eighth Edition, Pearson Education. Text Books: 1. Carpinelli J.D,” Computer systems organization &Architecture”, Fourth Edition, Addison Wesley. 2. Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon Kauffman. Reference Website 1. https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/ 20
  • 21. Assessment Pattern • Element1(Assignment 1,2,3(Average)): 12 Marks • Element2(Surprise Test): 9 Marks • Element3(Tutorial/Optional): 9 Marks • Element4(Quiz): 12 Marks • MST1: 36 Marks • MST2: 36 Marks • Final Examination: 60 Marks 21