SlideShare a Scribd company logo
1 of 28
Organisasi dan Arsitektur
Komputer
Ajeng Savitri Puspaningrum, M.Kom
Pertemuan 26
Memory (Part 2)
 Learning the Definition of Cache
 Learning How Cache’s Works
 Learning Characteristic of Cache
So you want fast?
 It is possible to build a computer which uses only static RAM
(see later)
 This would be very fast
 This would need no cache
 How can you cache cache?
 This would cost a very large amount
Cache
 Small amount of fast memory
 Sits between normal main memory and CPU
 May be located on CPU chip or module
Cache Memory
 Mekanisme penyimpanan data sekunder berkecepatan tinggi yang
digunakan untuk menyimpan data / instruksi yang sering diakses.
 Memberi kecepatan memori yang mendekati memori yang paling
cepat yang bisa diperoleh, dan pada waktu yang sama
menyediakan kapasitas memori yang besar dengan harga yang
lebih murah dari jenis-jenis memori semikonduktor.
Cache and Main Memory
Cara Kerja
 Komputer membutuhkan data
 Mencarinya pada Cache.
 Jika data ditemukan, prosesor akan langsung membacanya
dengan delay yang sangat kecil. Tetapi jika data yang dicari
tidak ditemukan,prosesor akan mencarinya pada RAM yang
kecepatannya lebih rendah.
 Kapasitas memori cache yang semakin besar juga akan
meningkatkan kecepatan kerja komputer secara keseluruhan.
Cache Read Operation -
Flowchart
Cache Design
 Addressing
 Size
 Mapping Function
 Replacement Algorithm
 Write Policy
 Block Size
 Number of Caches
Cache Addressing
 Where does cache sit?
 Between processor and virtual memory management unit
 Between MMU and main memory
 Logical cache (virtual cache) stores data using virtual addresses
 Processor accesses cache directly, not thorough physical cache
 Cache access faster, before MMU address translation
 Virtual addresses use same address space for different applications
Must flush cache on each context switch
 Physical cache stores data using main memory physical addresses
Size does matter
 Cost
 More cache is expensive
 Speed
 More cache is faster (up to a point)
 Checking cache for data takes time
Direct Mapping
 Each block of main memory maps to only one cache line
 i.e. if a block is in cache, it must be in one specific place
 Address is in two parts
 Least Significant w bits identify unique word
 Most Significant s bits specify one memory block
 The MSBs are split into a cache line field r and a tag of s-r
(most significant)
Direct Mapping Summary
 Address length = (s + w) bits
 Number of addressable units = 2s+w words or bytes
 Block size = line size = 2w words or bytes
 Number of blocks in main memory = 2s+ w/2w = 2s
 Number of lines in cache = m = 2r
 Size of tag = (s – r) bits
Direct Mapping Pros & Cons
 Simple
 Inexpensive
 Fixed location for given block
 If a program accesses 2 blocks that map to the same line repeatedly,
cache misses are very high
Victim Cache
 Lower miss penalty
 Remember what was discarded
 Already fetched
 Use again with little penalty
 Fully associative
 4 to 16 cache lines
 Between direct mapped L1 cache and next memory level
Associative Mapping
 A main memory block can load into any line of cache
 Memory address is interpreted as tag and word
 Tag uniquely identifies block of memory
 Every line’s tag is examined for a match
 Cache searching gets expensive
Associative Mapping
 A main memory block can load into any line of cache
 Memory address is interpreted as tag and word
 Tag uniquely identifies block of memory
 Every line’s tag is examined for a match
 Cache searching gets expensive
Direct and Set Associative Cache
Performance Differences
 Significant up to at least 64kB for 2-way
 Difference between 2-way and 4-way at 4kB much less than
4kB to 8kB
 Cache complexity increases with associativity
 Not justified against increasing cache to 8kB or 16kB
 Above 32kB gives no improvement
 (simulation results)
Memori Internal dan External
 Memori internal adalah memori yang dapat diakses
langsung oleh prosesor
 register yang terdapat di dalam prosesor, cache memori dan
memori utama berada di luar prosesor.
 Memori eksternal adalah memori yang diakses prosesor
melalui piranti I/O
 disket dan hardisk.
Operasi Sel Memori
 Elemen dasar memori
 Sel memori memiliki sifat – sifat tertentu
Sifat Sel Memori
 Sel memori memiliki dua keadaan stabil (atau semi-stabil),
yang dapat digunakan untuk merepresentasikan bilangan
biner 1 atau 0.
 Sel memori mempunyai kemampuan untuk ditulisi
(sedikitnya satu kali).
 Sel memori mempunyai kemampuan untuk dibaca.
Terminal Fungsi Sel Memori
Main Memory
 Memori utama merupakan media penyimpanan dalam bentuk
array yang disusun word atau byte, kapasitas daya simpannya bisa
jutaan susunan.
 Setiap word atau byte mempunyai alamat tersendiri.
 Data yang disimpan pada memori utama ini bersifat volatile.
 Memori utama digunakan sebagai media penyimpanan data yang
berkaitan dengan CPU atau perangkat I/O.
Tipe Main Memory
Random Access Memory ( RAM )
Read Only Memory ( ROM )
CMOS Memory
Virtual Memory
Main Memory
Semiconductor Memory Types
Memory Type Category Erasure Write Mechanism Volatility
Random-access
memory (RAM)
Read-write memory Electrically, byte-level Electrically Volatile
Read-only
memory (ROM)
Read-only memory Not possible
Masks
Nonvolatile
Programmable
ROM (PROM)
Electrically
Erasable PROM
(EPROM)
Read-mostly memory
UV light, chip-level
Electrically Erasable
PROM (EEPROM)
Electrically, byte-level
Flash memory Electrically, block-level
Refference
Stalling, William, Computer Organization
and Architecture, 10th Edition, Pearson,
2015
Abdurohman, Maman, Organisasi dan
Arsitektur Komputer revisi ke-4, Penerbit
Informatika, 2017
Terima Kasih
ajeng.savitri@teknokrat.ac.id
https://teknokrat.ac.id/en/
https://spada.teknokrat.ac.id/

More Related Content

What's hot

What's hot (8)

Latch and ram (random access memory)
Latch and ram (random access memory)Latch and ram (random access memory)
Latch and ram (random access memory)
 
Cache memory
Cache memoryCache memory
Cache memory
 
multiprosesor & multikomputer
multiprosesor & multikomputermultiprosesor & multikomputer
multiprosesor & multikomputer
 
07. memory
07. memory07. memory
07. memory
 
Tugas mulok
Tugas mulokTugas mulok
Tugas mulok
 
set associative mapping
set associative mappingset associative mapping
set associative mapping
 
Makalah memori
Makalah memoriMakalah memori
Makalah memori
 
Desain memory
Desain memoryDesain memory
Desain memory
 

Similar to Memory (Part 2)

Memoryi internal-eksternal
Memoryi internal-eksternalMemoryi internal-eksternal
Memoryi internal-eksternalsyamsinur
 
Pertemuan 5 organisasi input output
Pertemuan 5 organisasi input outputPertemuan 5 organisasi input output
Pertemuan 5 organisasi input outputjumiathyasiz
 
Pengenalan hardware[1]
Pengenalan hardware[1]Pengenalan hardware[1]
Pengenalan hardware[1]febriantifebi1
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwarenurulnailah
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwareKanKaneki
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwareMuhtrii7
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwareKanKaneki
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwarenursafitri14
 
Pengenalan Hardware
Pengenalan HardwarePengenalan Hardware
Pengenalan HardwareAliTaufiq1
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardwarenursafitri14
 
Tugas PPT Memori Internal.pptx
Tugas PPT Memori Internal.pptxTugas PPT Memori Internal.pptx
Tugas PPT Memori Internal.pptxAryawidiarta
 

Similar to Memory (Part 2) (20)

Memoryi internal-eksternal
Memoryi internal-eksternalMemoryi internal-eksternal
Memoryi internal-eksternal
 
Pertemuan 5 organisasi input output
Pertemuan 5 organisasi input outputPertemuan 5 organisasi input output
Pertemuan 5 organisasi input output
 
Pertemuan 10 memory
Pertemuan 10 memoryPertemuan 10 memory
Pertemuan 10 memory
 
Pengenalan hardware[1]
Pengenalan hardware[1]Pengenalan hardware[1]
Pengenalan hardware[1]
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan Hardware
Pengenalan HardwarePengenalan Hardware
Pengenalan Hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan Hardware
Pengenalan HardwarePengenalan Hardware
Pengenalan Hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Pengenalan Hardware
Pengenalan HardwarePengenalan Hardware
Pengenalan Hardware
 
Pengenalan Hardware
Pengenalan HardwarePengenalan Hardware
Pengenalan Hardware
 
Pengenalan hardware
Pengenalan hardwarePengenalan hardware
Pengenalan hardware
 
Tugas PPT Memori Internal.pptx
Tugas PPT Memori Internal.pptxTugas PPT Memori Internal.pptx
Tugas PPT Memori Internal.pptx
 
pertemuan-5-memory1.ppt
pertemuan-5-memory1.pptpertemuan-5-memory1.ppt
pertemuan-5-memory1.ppt
 
08. memory 2
08. memory 208. memory 2
08. memory 2
 
Internal memory
Internal memoryInternal memory
Internal memory
 

More from Ajeng Savitri

Software Testing Documentation
Software Testing DocumentationSoftware Testing Documentation
Software Testing DocumentationAjeng Savitri
 
Software Productivity Measurement
Software Productivity MeasurementSoftware Productivity Measurement
Software Productivity MeasurementAjeng Savitri
 
Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)Ajeng Savitri
 
Software Testing Strategy
Software Testing StrategySoftware Testing Strategy
Software Testing StrategyAjeng Savitri
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented TestingAjeng Savitri
 
Testing Technique (Part 2)
Testing Technique (Part 2)Testing Technique (Part 2)
Testing Technique (Part 2)Ajeng Savitri
 
Methodology Selection Strategy
Methodology Selection Strategy Methodology Selection Strategy
Methodology Selection Strategy Ajeng Savitri
 
Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)Ajeng Savitri
 
Software Testing - Software Quality
Software Testing - Software QualitySoftware Testing - Software Quality
Software Testing - Software QualityAjeng Savitri
 
Computer Evolution and Performance
Computer Evolution and PerformanceComputer Evolution and Performance
Computer Evolution and PerformanceAjeng Savitri
 
Software Testing - Introduction
Software Testing - IntroductionSoftware Testing - Introduction
Software Testing - IntroductionAjeng Savitri
 
Requirement Gathering
Requirement GatheringRequirement Gathering
Requirement GatheringAjeng Savitri
 

More from Ajeng Savitri (20)

Software Testing Documentation
Software Testing DocumentationSoftware Testing Documentation
Software Testing Documentation
 
Software Productivity Measurement
Software Productivity MeasurementSoftware Productivity Measurement
Software Productivity Measurement
 
Debugging (Part 2)
Debugging (Part 2)Debugging (Part 2)
Debugging (Part 2)
 
Debugging
DebuggingDebugging
Debugging
 
Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)
 
Software Testing Strategy
Software Testing StrategySoftware Testing Strategy
Software Testing Strategy
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
Testing Technique (Part 2)
Testing Technique (Part 2)Testing Technique (Part 2)
Testing Technique (Part 2)
 
Testing Technique
Testing TechniqueTesting Technique
Testing Technique
 
Testing Plan
Testing PlanTesting Plan
Testing Plan
 
Methodology Selection Strategy
Methodology Selection Strategy Methodology Selection Strategy
Methodology Selection Strategy
 
Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)
 
Software Testing - Software Quality
Software Testing - Software QualitySoftware Testing - Software Quality
Software Testing - Software Quality
 
Computer Evolution and Performance
Computer Evolution and PerformanceComputer Evolution and Performance
Computer Evolution and Performance
 
Software Testing - Introduction
Software Testing - IntroductionSoftware Testing - Introduction
Software Testing - Introduction
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Requirement Gathering
Requirement GatheringRequirement Gathering
Requirement Gathering
 
Business Value
Business ValueBusiness Value
Business Value
 

Memory (Part 2)

  • 1. Organisasi dan Arsitektur Komputer Ajeng Savitri Puspaningrum, M.Kom Pertemuan 26
  • 3.  Learning the Definition of Cache  Learning How Cache’s Works  Learning Characteristic of Cache
  • 4. So you want fast?  It is possible to build a computer which uses only static RAM (see later)  This would be very fast  This would need no cache  How can you cache cache?  This would cost a very large amount
  • 5. Cache  Small amount of fast memory  Sits between normal main memory and CPU  May be located on CPU chip or module
  • 6. Cache Memory  Mekanisme penyimpanan data sekunder berkecepatan tinggi yang digunakan untuk menyimpan data / instruksi yang sering diakses.  Memberi kecepatan memori yang mendekati memori yang paling cepat yang bisa diperoleh, dan pada waktu yang sama menyediakan kapasitas memori yang besar dengan harga yang lebih murah dari jenis-jenis memori semikonduktor.
  • 7. Cache and Main Memory
  • 8. Cara Kerja  Komputer membutuhkan data  Mencarinya pada Cache.  Jika data ditemukan, prosesor akan langsung membacanya dengan delay yang sangat kecil. Tetapi jika data yang dicari tidak ditemukan,prosesor akan mencarinya pada RAM yang kecepatannya lebih rendah.  Kapasitas memori cache yang semakin besar juga akan meningkatkan kecepatan kerja komputer secara keseluruhan.
  • 9. Cache Read Operation - Flowchart
  • 10. Cache Design  Addressing  Size  Mapping Function  Replacement Algorithm  Write Policy  Block Size  Number of Caches
  • 11. Cache Addressing  Where does cache sit?  Between processor and virtual memory management unit  Between MMU and main memory  Logical cache (virtual cache) stores data using virtual addresses  Processor accesses cache directly, not thorough physical cache  Cache access faster, before MMU address translation  Virtual addresses use same address space for different applications Must flush cache on each context switch  Physical cache stores data using main memory physical addresses
  • 12. Size does matter  Cost  More cache is expensive  Speed  More cache is faster (up to a point)  Checking cache for data takes time
  • 13. Direct Mapping  Each block of main memory maps to only one cache line  i.e. if a block is in cache, it must be in one specific place  Address is in two parts  Least Significant w bits identify unique word  Most Significant s bits specify one memory block  The MSBs are split into a cache line field r and a tag of s-r (most significant)
  • 14. Direct Mapping Summary  Address length = (s + w) bits  Number of addressable units = 2s+w words or bytes  Block size = line size = 2w words or bytes  Number of blocks in main memory = 2s+ w/2w = 2s  Number of lines in cache = m = 2r  Size of tag = (s – r) bits
  • 15. Direct Mapping Pros & Cons  Simple  Inexpensive  Fixed location for given block  If a program accesses 2 blocks that map to the same line repeatedly, cache misses are very high
  • 16. Victim Cache  Lower miss penalty  Remember what was discarded  Already fetched  Use again with little penalty  Fully associative  4 to 16 cache lines  Between direct mapped L1 cache and next memory level
  • 17. Associative Mapping  A main memory block can load into any line of cache  Memory address is interpreted as tag and word  Tag uniquely identifies block of memory  Every line’s tag is examined for a match  Cache searching gets expensive
  • 18. Associative Mapping  A main memory block can load into any line of cache  Memory address is interpreted as tag and word  Tag uniquely identifies block of memory  Every line’s tag is examined for a match  Cache searching gets expensive
  • 19. Direct and Set Associative Cache Performance Differences  Significant up to at least 64kB for 2-way  Difference between 2-way and 4-way at 4kB much less than 4kB to 8kB  Cache complexity increases with associativity  Not justified against increasing cache to 8kB or 16kB  Above 32kB gives no improvement  (simulation results)
  • 20. Memori Internal dan External  Memori internal adalah memori yang dapat diakses langsung oleh prosesor  register yang terdapat di dalam prosesor, cache memori dan memori utama berada di luar prosesor.  Memori eksternal adalah memori yang diakses prosesor melalui piranti I/O  disket dan hardisk.
  • 21. Operasi Sel Memori  Elemen dasar memori  Sel memori memiliki sifat – sifat tertentu
  • 22. Sifat Sel Memori  Sel memori memiliki dua keadaan stabil (atau semi-stabil), yang dapat digunakan untuk merepresentasikan bilangan biner 1 atau 0.  Sel memori mempunyai kemampuan untuk ditulisi (sedikitnya satu kali).  Sel memori mempunyai kemampuan untuk dibaca.
  • 24. Main Memory  Memori utama merupakan media penyimpanan dalam bentuk array yang disusun word atau byte, kapasitas daya simpannya bisa jutaan susunan.  Setiap word atau byte mempunyai alamat tersendiri.  Data yang disimpan pada memori utama ini bersifat volatile.  Memori utama digunakan sebagai media penyimpanan data yang berkaitan dengan CPU atau perangkat I/O.
  • 25. Tipe Main Memory Random Access Memory ( RAM ) Read Only Memory ( ROM ) CMOS Memory Virtual Memory Main Memory
  • 26. Semiconductor Memory Types Memory Type Category Erasure Write Mechanism Volatility Random-access memory (RAM) Read-write memory Electrically, byte-level Electrically Volatile Read-only memory (ROM) Read-only memory Not possible Masks Nonvolatile Programmable ROM (PROM) Electrically Erasable PROM (EPROM) Read-mostly memory UV light, chip-level Electrically Erasable PROM (EEPROM) Electrically, byte-level Flash memory Electrically, block-level
  • 27. Refference Stalling, William, Computer Organization and Architecture, 10th Edition, Pearson, 2015 Abdurohman, Maman, Organisasi dan Arsitektur Komputer revisi ke-4, Penerbit Informatika, 2017