This document discusses cache memory organization and characteristics. It begins by listing characteristics of cache memory such as location, capacity, access methods, and physical types. It then discusses specific cache memory topics in more detail, including direct mapping, set associative mapping, replacement algorithms, write policies, and examples of cache sizes from different processors over time. The document aims to explain the basic concepts of cache memory.
Cache memory provides fast access to recently accessed data. It sits between the CPU and main memory. There are three key aspects of cache design - mapping function, replacement algorithm, and write policy. The mapping function determines how addresses map to cache locations. Direct mapping maps each block to one location, while associative mapping allows blocks to map to any location. Replacement algorithms determine which block to replace when new data is added. Write policies handle updating memory on writes.
Cache Memory for Computer Architecture.pptrularofclash69
The document discusses cache memory characteristics including location, capacity, unit of transfer, access methods, performance, physical type, organization, and mapping functions. It provides details on direct mapping, associative mapping, set associative mapping, replacement algorithms, and write policies for cache memory. Key aspects covered include cache hierarchy, cache operation, typical cache organization, comparison of cache sizes over time, and how mapping functions, block size, and number of sets/ways impact cache design.
This document summarizes key characteristics of cache memory including location, capacity, access methods, performance, and organization. It discusses the memory hierarchy from registers to external memory. Common cache mapping techniques like direct mapping, set associative mapping, and fully associative mapping are explained. The document also covers cache performance, replacement algorithms, write policies, and how locality of reference relates to cache effectiveness.
This document discusses cache memory organization and characteristics. It begins by describing cache location, capacity, unit of transfer, access methods, performance, physical type, and organization. It then provides more details on location, capacity, unit of transfer, access methods including sequential, direct, random and associative, and memory hierarchy including registers, main memory, and external memory. The document also discusses performance metrics, physical types, physical characteristics, cache organization methods like direct mapping, set associative mapping, and replacement algorithms. It covers write policies, line size, multilevel caches, hit ratios, and unified versus split caches. Specific processor cache architectures like those of the Pentium 4 are also summarized.
This document summarizes key characteristics of cache memory including location, capacity, unit of transfer, access methods, performance, physical characteristics, and organization. It describes the memory hierarchy including registers, cache, main memory, and external memory. It discusses different cache mapping techniques like direct mapping, set associative mapping, and fully associative mapping. The document also covers cache performance factors like hit ratio, replacement algorithms, write policies, line size, and multilevel caches. It provides examples of cache organizations from various processors like Intel Pentium 4.
This document discusses cache memory organization and characteristics. It begins by describing cache location, capacity, unit of transfer, access methods, and physical characteristics. It then covers the different mapping techniques used in caches, including direct mapping, set associative mapping, and fully associative mapping. The document also discusses cache performance factors like hit ratio, replacement algorithms, write policies, block size, and multilevel cache hierarchies. It provides examples of specific processor cache designs like those used in Intel Pentium processors.
This is a presentation on Cache Memory.
It is an important topic of Computer Organization and Architecture course.
It is generally taught in 2nd year of BTech CSE course in most of the colleges in India.
This is a summary of the topic from the book on Computer Organization and Architecture by William Stallings (a very famous author).
This will help aid in the student's overall learning about COA subject.
This document summarizes key characteristics of cache memory including location, capacity, access methods, performance, and organization. It discusses the memory hierarchy from registers to external memory. Common cache mapping techniques like direct mapping, associative mapping, and set associative mapping are explained. The document also covers cache design considerations such as replacement algorithms and write policies.
This document summarizes key characteristics of cache memory including location, capacity, unit of transfer, access methods, performance, physical types, organization, and memory hierarchy. It discusses different cache mapping techniques like direct mapping, set associative mapping, and fully associative mapping. The document also covers cache performance factors like hit ratio, replacement algorithms, write policies, line size, and multilevel caches. As an example, it analyzes the cache architecture of Intel Pentium 4 processor.
Cache memory is a small, fast memory located close to the CPU that stores frequently accessed instructions and data from main memory. It improves performance by reducing access time compared to main memory. There are three main characteristics of cache memory: 1) it uses the principle of locality of reference, where data that is accessed once is likely to be accessed again soon; 2) it is organized into blocks that are transferred between cache and main memory as a unit; and 3) it uses mapping and tagging to determine if requested data is in cache or needs to be fetched from main memory.
Cache memory is a smaller, faster memory component that stores frequently used data and instructions, acting as a buffer between the CPU and the main memory (RAM). This speeds up access to data and instructions, improving overall system performance.
Key Concepts:
Purpose:
To reduce the time it takes for the CPU to access data by storing frequently used data in a faster, smaller memory.
Location:
Situated between the CPU and RAM, often located on the CPU chip itself or on the motherboard.
Types:
Level 1 (L1) Cache: Fastest and smallest, located within the CPU core.
Level 2 (L2) Cache: Larger and slightly slower than L1, often located on the CPU chip.
Level 3 (L3) Cache: Largest and slowest, located on the CPU chip or motherboard.
Speed and Size:
Cache memory is significantly faster than RAM, but it has a smaller capacity.
Function:
When the CPU needs data, it first checks the cache. If the data is found (a "cache hit"), it's accessed quickly. If not (a "cache miss"), the CPU retrieves the data from RAM, which takes longer.
Benefits:
Faster Data Access:
By storing frequently accessed data, cache memory reduces the need to access slower RAM, leading to faster processing speeds.
Improved Performance:
Reduced waiting times for data access translates to quicker application loading, smoother website browsing, and overall improved system responsiveness.
Energy Efficiency:
In some cases, reduced CPU workload due to cache memory can contribute to lower power consumption and longer battery life, especially in laptops.
Cache memory is a smaller, faster memory component that stores frequently used data and instructions, acting as a buffer between the CPU and the main memory (RAM). This speeds up access to data and instructions, improving overall system performance.
Key Concepts:
Purpose:
To reduce the time it takes for the CPU to access data by storing frequently used data in a faster, smaller memory.
Location:
Situated between the CPU and RAM, often located on the CPU chip itself or on the motherboard.
Types:
Level 1 (L1) Cache: Fastest and smallest, located within the CPU core.
Level 2 (L2) Cache: Larger and slightly slower than L1, often located on the CPU chip.
Level 3 (L3) Cache: Largest and slowest, located on the CPU chip or motherboard.
Speed and Size:
Cache memory is significantly faster than RAM, but it has a smaller capacity.
Function:
When the CPU needs data, it first checks the cache. If the data is found (a "cache hit"), it's accessed quickly. If not (a "cache miss"), the CPU retrieves the data from RAM, which takes longer.
Benefits:
Faster Data Access:
By storing frequently accessed data, cache memory reduces the need to access slower RAM, leading to faster processing speeds.
Improved Performance:
Reduced waiting times for data access translates to quicker application loading, smoother website browsing, and overall improved system responsiveness.
Energy Efficiency:
In some cases, reduced CPU workload due to cache memory can con
The document discusses characteristics of computer memory systems including location, capacity, unit of transfer, access methods, performance, physical type, organization, and hierarchy. It covers different types of memory like registers, cache, main memory, disk, and tape. It describes cache mapping techniques like direct, associative, and set associative mapping. It also discusses memory management techniques like page replacement algorithms like FIFO, LRU and optimal page replacement. Finally, it provides an overview of input/output modules that interface between the CPU and external devices.
Cache memory is a type of fast memory located close to the CPU that temporarily stores frequently accessed data from main memory to improve performance. There are multiple levels of cache with different characteristics. The L1 cache is the fastest but smallest, located directly on the CPU chip, while higher level caches like L2 and L3 are larger but slower. Caches use mapping functions like direct mapping, set associative mapping, and fully associative mapping to determine where to store data blocks from main memory in the cache.
Cache memory is a small, fast memory located between the CPU and main memory that temporarily stores frequently accessed data. It improves performance by providing faster access for the CPU compared to accessing main memory. There are different types of cache memory organization including direct mapping, set associative mapping, and fully associative mapping. Direct mapping maps each block of main memory to only one location in cache while set associative mapping divides the cache into sets with multiple lines per set allowing a block to map to any line within a set.
This document discusses memory hierarchy and caching. It begins by describing the memory hierarchy pyramid from fastest and smallest (registers) to slowest and largest (disk). The key concepts of locality of reference—temporal and spatial locality—are introduced. Cache aims to exploit locality by storing recently accessed data in faster memory closer to the CPU. Direct mapping, set associative mapping, and fully associative mapping are described as techniques for mapping memory blocks to cache lines. Replacement policies for determining which cache line to overwrite are also discussed.
This document discusses memory hierarchy and caching. It can be summarized as follows:
1. Memory is organized in a hierarchy from fastest and smallest (registers and cache) to slowest and largest (disk). Cache sits between CPU and main memory to improve performance by exploiting locality of reference.
2. Caches use mapping functions to determine which block of main memory corresponds to each cache line. Direct mapping allocates blocks to lines in a fixed way while fully associative mapping allows blocks to map to any line.
3. Cache hits are faster than misses, which involve reading a block from lower levels. Hit rates above 95% can improve average memory access time significantly compared to lower hit rates.
The document discusses cache design and organization. It describes how caches work, sitting between the CPU and main memory to provide fast access to frequently used data. The key aspects covered include cache size, block size, mapping techniques, replacement algorithms, write policies, and the evolution of cache hierarchies in processors like the Pentium IV with multiple levels of on-chip and off-chip caches.
The document discusses cache design and organization. It describes how caches work, sitting between the CPU and main memory to provide fast access to frequently used data. The key aspects covered include cache size, block size, mapping techniques, replacement algorithms, write policies, and the evolution of cache hierarchies in processors like the Pentium IV with multiple levels of on-chip and off-chip caches.
Computer System Architecture Lecture Note 8.1 primary MemoryBudditha Hettige
This document provides information about computer memory architecture. It discusses the memory hierarchy from registers to disk and describes the different levels of cache memory. It also covers topics like primary memory, virtual memory, RAM types (SRAM, DRAM, SDRAM), memory errors, parity checking, ECC, and magnetic disk storage.
This document discusses various aspects of computer memory systems including cache memory. It begins by defining key terms related to memory such as capacity, organization, access methods, and physical characteristics. It then covers cache memory in particular, explaining the basic concept of caching as well as aspects of cache design like mapping, replacement algorithms, and write policies. Examples of cache configurations from different processor models over time are also provided.
This document discusses cache memory organization and characteristics. It begins by describing cache location, capacity, unit of transfer, access methods, and physical characteristics. It then covers the different mapping techniques used in caches, including direct mapping, set associative mapping, and fully associative mapping. The document also discusses cache performance factors like hit ratio, replacement algorithms, write policies, block size, and multilevel cache hierarchies. It provides examples of specific processor cache designs like those used in Intel Pentium processors.
This is a presentation on Cache Memory.
It is an important topic of Computer Organization and Architecture course.
It is generally taught in 2nd year of BTech CSE course in most of the colleges in India.
This is a summary of the topic from the book on Computer Organization and Architecture by William Stallings (a very famous author).
This will help aid in the student's overall learning about COA subject.
This document summarizes key characteristics of cache memory including location, capacity, access methods, performance, and organization. It discusses the memory hierarchy from registers to external memory. Common cache mapping techniques like direct mapping, associative mapping, and set associative mapping are explained. The document also covers cache design considerations such as replacement algorithms and write policies.
This document summarizes key characteristics of cache memory including location, capacity, unit of transfer, access methods, performance, physical types, organization, and memory hierarchy. It discusses different cache mapping techniques like direct mapping, set associative mapping, and fully associative mapping. The document also covers cache performance factors like hit ratio, replacement algorithms, write policies, line size, and multilevel caches. As an example, it analyzes the cache architecture of Intel Pentium 4 processor.
Cache memory is a small, fast memory located close to the CPU that stores frequently accessed instructions and data from main memory. It improves performance by reducing access time compared to main memory. There are three main characteristics of cache memory: 1) it uses the principle of locality of reference, where data that is accessed once is likely to be accessed again soon; 2) it is organized into blocks that are transferred between cache and main memory as a unit; and 3) it uses mapping and tagging to determine if requested data is in cache or needs to be fetched from main memory.
Cache memory is a smaller, faster memory component that stores frequently used data and instructions, acting as a buffer between the CPU and the main memory (RAM). This speeds up access to data and instructions, improving overall system performance.
Key Concepts:
Purpose:
To reduce the time it takes for the CPU to access data by storing frequently used data in a faster, smaller memory.
Location:
Situated between the CPU and RAM, often located on the CPU chip itself or on the motherboard.
Types:
Level 1 (L1) Cache: Fastest and smallest, located within the CPU core.
Level 2 (L2) Cache: Larger and slightly slower than L1, often located on the CPU chip.
Level 3 (L3) Cache: Largest and slowest, located on the CPU chip or motherboard.
Speed and Size:
Cache memory is significantly faster than RAM, but it has a smaller capacity.
Function:
When the CPU needs data, it first checks the cache. If the data is found (a "cache hit"), it's accessed quickly. If not (a "cache miss"), the CPU retrieves the data from RAM, which takes longer.
Benefits:
Faster Data Access:
By storing frequently accessed data, cache memory reduces the need to access slower RAM, leading to faster processing speeds.
Improved Performance:
Reduced waiting times for data access translates to quicker application loading, smoother website browsing, and overall improved system responsiveness.
Energy Efficiency:
In some cases, reduced CPU workload due to cache memory can contribute to lower power consumption and longer battery life, especially in laptops.
Cache memory is a smaller, faster memory component that stores frequently used data and instructions, acting as a buffer between the CPU and the main memory (RAM). This speeds up access to data and instructions, improving overall system performance.
Key Concepts:
Purpose:
To reduce the time it takes for the CPU to access data by storing frequently used data in a faster, smaller memory.
Location:
Situated between the CPU and RAM, often located on the CPU chip itself or on the motherboard.
Types:
Level 1 (L1) Cache: Fastest and smallest, located within the CPU core.
Level 2 (L2) Cache: Larger and slightly slower than L1, often located on the CPU chip.
Level 3 (L3) Cache: Largest and slowest, located on the CPU chip or motherboard.
Speed and Size:
Cache memory is significantly faster than RAM, but it has a smaller capacity.
Function:
When the CPU needs data, it first checks the cache. If the data is found (a "cache hit"), it's accessed quickly. If not (a "cache miss"), the CPU retrieves the data from RAM, which takes longer.
Benefits:
Faster Data Access:
By storing frequently accessed data, cache memory reduces the need to access slower RAM, leading to faster processing speeds.
Improved Performance:
Reduced waiting times for data access translates to quicker application loading, smoother website browsing, and overall improved system responsiveness.
Energy Efficiency:
In some cases, reduced CPU workload due to cache memory can con
The document discusses characteristics of computer memory systems including location, capacity, unit of transfer, access methods, performance, physical type, organization, and hierarchy. It covers different types of memory like registers, cache, main memory, disk, and tape. It describes cache mapping techniques like direct, associative, and set associative mapping. It also discusses memory management techniques like page replacement algorithms like FIFO, LRU and optimal page replacement. Finally, it provides an overview of input/output modules that interface between the CPU and external devices.
Cache memory is a type of fast memory located close to the CPU that temporarily stores frequently accessed data from main memory to improve performance. There are multiple levels of cache with different characteristics. The L1 cache is the fastest but smallest, located directly on the CPU chip, while higher level caches like L2 and L3 are larger but slower. Caches use mapping functions like direct mapping, set associative mapping, and fully associative mapping to determine where to store data blocks from main memory in the cache.
Cache memory is a small, fast memory located between the CPU and main memory that temporarily stores frequently accessed data. It improves performance by providing faster access for the CPU compared to accessing main memory. There are different types of cache memory organization including direct mapping, set associative mapping, and fully associative mapping. Direct mapping maps each block of main memory to only one location in cache while set associative mapping divides the cache into sets with multiple lines per set allowing a block to map to any line within a set.
This document discusses memory hierarchy and caching. It begins by describing the memory hierarchy pyramid from fastest and smallest (registers) to slowest and largest (disk). The key concepts of locality of reference—temporal and spatial locality—are introduced. Cache aims to exploit locality by storing recently accessed data in faster memory closer to the CPU. Direct mapping, set associative mapping, and fully associative mapping are described as techniques for mapping memory blocks to cache lines. Replacement policies for determining which cache line to overwrite are also discussed.
This document discusses memory hierarchy and caching. It can be summarized as follows:
1. Memory is organized in a hierarchy from fastest and smallest (registers and cache) to slowest and largest (disk). Cache sits between CPU and main memory to improve performance by exploiting locality of reference.
2. Caches use mapping functions to determine which block of main memory corresponds to each cache line. Direct mapping allocates blocks to lines in a fixed way while fully associative mapping allows blocks to map to any line.
3. Cache hits are faster than misses, which involve reading a block from lower levels. Hit rates above 95% can improve average memory access time significantly compared to lower hit rates.
The document discusses cache design and organization. It describes how caches work, sitting between the CPU and main memory to provide fast access to frequently used data. The key aspects covered include cache size, block size, mapping techniques, replacement algorithms, write policies, and the evolution of cache hierarchies in processors like the Pentium IV with multiple levels of on-chip and off-chip caches.
The document discusses cache design and organization. It describes how caches work, sitting between the CPU and main memory to provide fast access to frequently used data. The key aspects covered include cache size, block size, mapping techniques, replacement algorithms, write policies, and the evolution of cache hierarchies in processors like the Pentium IV with multiple levels of on-chip and off-chip caches.
Computer System Architecture Lecture Note 8.1 primary MemoryBudditha Hettige
This document provides information about computer memory architecture. It discusses the memory hierarchy from registers to disk and describes the different levels of cache memory. It also covers topics like primary memory, virtual memory, RAM types (SRAM, DRAM, SDRAM), memory errors, parity checking, ECC, and magnetic disk storage.
This document discusses various aspects of computer memory systems including cache memory. It begins by defining key terms related to memory such as capacity, organization, access methods, and physical characteristics. It then covers cache memory in particular, explaining the basic concept of caching as well as aspects of cache design like mapping, replacement algorithms, and write policies. Examples of cache configurations from different processor models over time are also provided.
When we associate semantic rules with productions, we use two notations:
Syntax-Directed Definitions
Translation Schemes
Syntax-Directed Definitions:
give high-level specifications for translations
hide many implementation details such as order of evaluation of semantic actions.
We associate a production rule with a set of semantic actions, and we do not say when they will be evaluated.
Translation Schemes:
indicate the order of evaluation of semantic actions associated with a production rule.
In other words, translation schemes give a little bit information about implementation details.
Sorting Order and Stability in Sorting.
Concept of Internal and External Sorting.
Bubble Sort,
Insertion Sort,
Selection Sort,
Quick Sort and
Merge Sort,
Radix Sort, and
Shell Sort,
External Sorting, Time complexity analysis of Sorting Algorithms.
YJIT can make Ruby code run faster, but this is a balancing act, because the JIT compiler itself must consume both memory and CPU cycles to compile and optimize your code while it is running. Furthermore, in large-scale production environments such as those of GitHub, Shopify and Stripe, we end up in a situation where YJIT is compiling the same code over and over again on a very large number of servers, which seems very inefficient.
In this presentation, we will go over the design of ZJIT, a next generation Ruby JIT which aims to save and reuse compiled code between executions. We hope that this will help us eliminate duplicated work while also allowing the compiler to spend more time optimizing code so that we can get better performance.
Value Stream Mapping Worskshops for Intelligent Continuous SecurityMarc Hornbeek
This presentation provides detailed guidance and tools for conducting Current State and Future State Value Stream Mapping workshops for Intelligent Continuous Security.
Data Structures_Linear data structures Linked Lists.pptxRushaliDeshmukh2
Concept of Linear Data Structures, Array as an ADT, Merging of two arrays, Storage
Representation, Linear list – singly linked list implementation, insertion, deletion and searching operations on linear list, circularly linked lists- Operations for Circularly linked lists, doubly linked
list implementation, insertion, deletion and searching operations, applications of linked lists.
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Guru
This PRIZ Academy deck walks you step-by-step through Functional Modeling in Action, showing how Subject-Action-Object (SAO) analysis pinpoints critical functions, ranks harmful interactions, and guides fast, focused improvements. You’ll see:
Core SAO concepts and scoring logic
A wafer-breakage case study that turns theory into practice
A live PRIZ Platform demo that builds the model in minutes
Ideal for engineers, QA managers, and innovation leads who need clearer system insight and faster root-cause fixes. Dive in, map functions, and start improving what really matters.
In tube drawing process, a tube is pulled out through a die and a plug to reduce its diameter and thickness as per the requirement. Dimensional accuracy of cold drawn tubes plays a vital role in the further quality of end products and controlling rejection in manufacturing processes of these end products. Springback phenomenon is the elastic strain recovery after removal of forming loads, causes geometrical inaccuracies in drawn tubes. Further, this leads to difficulty in achieving close dimensional tolerances. In the present work springback of EN 8 D tube material is studied for various cold drawing parameters. The process parameters in this work include die semi-angle, land width and drawing speed. The experimentation is done using Taguchi’s L36 orthogonal array, and then optimization is done in data analysis software Minitab 17. The results of ANOVA shows that 15 degrees die semi-angle,5 mm land width and 6 m/min drawing speed yields least springback. Furthermore, optimization algorithms named Particle Swarm Optimization (PSO), Simulated Annealing (SA) and Genetic Algorithm (GA) are applied which shows that 15 degrees die semi-angle, 10 mm land width and 8 m/min drawing speed results in minimal springback with almost 10.5 % improvement. Finally, the results of experimentation are validated with Finite Element Analysis technique using ANSYS.
its all about Artificial Intelligence(Ai) and Machine Learning and not on advanced level you can study before the exam or can check for some information on Ai for project
Fluid mechanics is the branch of physics concerned with the mechanics of fluids (liquids, gases, and plasmas) and the forces on them. Originally applied to water (hydromechanics), it found applications in a wide range of disciplines, including mechanical, aerospace, civil, chemical, and biomedical engineering, as well as geophysics, oceanography, meteorology, astrophysics, and biology.
It can be divided into fluid statics, the study of various fluids at rest, and fluid dynamics.
Fluid statics, also known as hydrostatics, is the study of fluids at rest, specifically when there's no relative motion between fluid particles. It focuses on the conditions under which fluids are in stable equilibrium and doesn't involve fluid motion.
Fluid kinematics is the branch of fluid mechanics that focuses on describing and analyzing the motion of fluids, such as liquids and gases, without considering the forces that cause the motion. It deals with the geometrical and temporal aspects of fluid flow, including velocity and acceleration. Fluid dynamics, on the other hand, considers the forces acting on the fluid.
Fluid dynamics is the study of the effect of forces on fluid motion. It is a branch of continuum mechanics, a subject which models matter without using the information that it is made out of atoms; that is, it models matter from a macroscopic viewpoint rather than from microscopic.
Fluid mechanics, especially fluid dynamics, is an active field of research, typically mathematically complex. Many problems are partly or wholly unsolved and are best addressed by numerical methods, typically using computers. A modern discipline, called computational fluid dynamics (CFD), is devoted to this approach. Particle image velocimetry, an experimental method for visualizing and analyzing fluid flow, also takes advantage of the highly visual nature of fluid flow.
Fundamentally, every fluid mechanical system is assumed to obey the basic laws :
Conservation of mass
Conservation of energy
Conservation of momentum
The continuum assumption
For example, the assumption that mass is conserved means that for any fixed control volume (for example, a spherical volume)—enclosed by a control surface—the rate of change of the mass contained in that volume is equal to the rate at which mass is passing through the surface from outside to inside, minus the rate at which mass is passing from inside to outside. This can be expressed as an equation in integral form over the control volume.
The continuum assumption is an idealization of continuum mechanics under which fluids can be treated as continuous, even though, on a microscopic scale, they are composed of molecules. Under the continuum assumption, macroscopic (observed/measurable) properties such as density, pressure, temperature, and bulk velocity are taken to be well-defined at "infinitesimal" volume elements—small in comparison to the characteristic length scale of the system, but large in comparison to molecular length scale
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfMohamedAbdelkader115
Glad to be one of only 14 members inside Kuwait to hold this credential.
Please check the members inside kuwait from this link:
https://www.rics.org/networking/find-a-member.html?firstname=&lastname=&town=&country=Kuwait&member_grade=(AssocRICS)&expert_witness=&accrediation=&page=1
5. Performance
• Access time
—Time between presenting the address and
getting the valid data
• Memory Cycle time
—Time may be required for the memory to
“recover” before next access
—Cycle time is access + recovery
• Transfer Rate
—Rate at which data can be moved
10. Cache operation – overview
• CPU requests contents of memory location
• Check cache for this data
• If present, get from cache (fast)
• If not present, read required block from
main memory to cache
• Then deliver from cache to CPU
• Cache includes tags to identify which
block of main memory is in each cache
slot
12. 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
13. Mapping Function
• Cache of 64kByte
• Cache block of 4 bytes
—i.e. cache is 16k (214
) lines of 4 bytes
• 16MBytes main memory
• 24 bit address
—(224
=16M)
14. 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)
15. Direct Mapping
Address Structure
Tag s-r Line or Slot r Word w
8 14 2
• 24 bit address
• 2 bit word identifier (4 byte block)
• 22 bit block identifier
— 8 bit tag (=22-14)
— 14 bit slot or line
• No two blocks in the same line have the same Tag field
• Check contents of cache by finding line and checking Tag
19. 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
20. 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
21. 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
24. Tag 22 bit
Word
2 bit
Associative Mapping
Address Structure
• 22 bit tag stored with each 32 bit block of data
• Compare tag field with tag entry in cache to
check for hit
• Least significant 2 bits of address identify which
16 bit word is required from 32 bit data block
• e.g.
—Address Tag Data Cache
line
—FFFFFC FFFFFC24682468 3FFF
25. Associative 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 = undetermined
• Size of tag = s bits
26. Set Associative Mapping
• Cache is divided into a number of sets
• Each set contains a number of lines
• A given block maps to any line in a given
set
—e.g. Block B can be in any line of set i
• e.g. 2 lines per set
—2 way associative mapping
—A given block can be in one of 2 lines in only
one set
27. Set Associative Mapping
Example
• 13 bit set number
• Block number in main memory is modulo
213
• 000000, 00A000, 00B000, 00C000 … map
to same set
31. Set Associative Mapping
Address Structure
• Use set field to determine cache set to
look in
• Compare tag field to see if we have a hit
• e.g
—Address Tag Data Set
number
—1FF 7FFC 1FF 12345678 1FFF
—001 7FFC 001 11223344 1FFF
Tag 9 bit Set 13 bit
Word
2 bit
32. Set Associative 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 = 2d
• Number of lines in set = k
• Number of sets = v = 2d
• Number of lines in cache = kv = k * 2d
• Size of tag = (s – d) bits
34. Replacement Algorithms (2)
Associative & Set Associative
• Hardware implemented algorithm (speed)
• Least Recently used (LRU)
• e.g. in 2 way set associative
—Which of the 2 block is lru?
• First in first out (FIFO)
—replace block that has been in cache longest
• Least frequently used
—replace block which has had fewest hits
• Random
35. Write Policy
• Must not overwrite a cache block unless
main memory is up to date
• Multiple CPUs may have individual caches
• I/O may address main memory directly
36. Write through
• All writes go to main memory as well as
cache
• Multiple CPUs can monitor main memory
traffic to keep local (to CPU) cache up to
date
• Lots of traffic
• Slows down writes
• Remember bogus write through caches!
37. Write back
• Updates initially made in cache only
• Update bit for cache slot is set when
update occurs
• If block is to be replaced, write to main
memory only if update bit is set
• Other caches get out of sync
• I/O must access main memory through
cache
• N.B. 15% of memory references are
writes
38. Multilevel Caches
• High logic density enables caches on chip
—Faster than bus access
—Frees bus for other transfers
• Common to use both on and off chip
cache
—L1 on chip, L2 off chip in static RAM
—L2 access much faster than DRAM or ROM
—L2 often uses separate data path
—L2 may now be on chip
—Resulting in L3 cache
– Bus access or now on chip…
39. Unified v Split Caches
• One cache for data and instructions or
two, one for data and one for instructions
• Advantages of unified cache
—Higher hit rate
– Balances load of instruction and data fetch
– Only one cache to design & implement
• Advantages of split cache
—Eliminates cache contention between
instruction fetch/decode unit and execution
unit
– Important in pipelining