Hit Ratio EXAMPLE Assume we have a paging system which uses associative

# Hit ratio example assume we have a paging system

This preview shows page 40 - 52 out of 72 pages.

Hit Ratio EXAMPLE: Assume we have a paging system which uses associative registers with a hit ratio of 90%. Assume associative registers have an access time of 30 nanoseconds, and the memory access time is 470 nanoseconds. Find the effective memory access time ( emat ) Case 1: The referenced page number is in associative registers: → Effective access time = 30 + 470 = 500 ns. Case 2: The page number is not found in associative registers: → Effective access time = 30 + 470 + 470 = 970 ns. The hit ratio is defined as the percentage of times that a page number is found in the associative registers; ratio related to number of associative registers With only 8 to 16 associative registers, a hit ratio higher than 80% can be achieved.
Hit Ratio Then the effective memory access time can be calculated as follows: emat = 0.90 * 500 + 0.10 * 970 = 450 + 97=547ns. So, on the average, there is a 547-470=77 ns slowdown
Segmentation systems Segmentation is a memory-management scheme that supports user view of memory. A program is a collection of segments. A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays
Segmentation In segmentation, programs are divided into variable size segments. Every logical address is formed of a segment number and an offset within that segment. Programs are segmented automatically by the compiler.
User’s View of a Program
Logical View of Segmentation 1 3 2 4 1 4 2 3 user space physical memory space
Segmentation Architecture Logical address consists of a two tuple: <segment-number, offset>, Segment table – maps two-dimensional physical addresses; each table entry has: base – contains the starting physical address where the segments reside in memory limit – specifies the length of the segment For logical to physical address mapping, a segment table (ST) is used. When a logical address <segment -numbr, d> is generated by the processor: Check if ( 0 ≤ d < limit ) in ST. If o.k., then the physical address is calculated as Base + d , and the physical memory is accessed at memory word ( Base + d ).
Segmentation Hardware
Example of Segmentation
Example of Segmentation For example, assume the logical address generated is <1,123> Check ST entry for segment #1. The limit for segment #1 is 400. Since 123<400,we carry on. The physical address is calculated as: 9300 + 123 = 9423, and the memory word 9423 is accessed.
Sharing of Segments Sharing text editor among users Sharing functions among programs
Virtual memory All the memory management policies we have discussed so far try to keep a number of processes in memory simultaneously to allow multiprogramming, but they require the entire process to be loaded in memory before it can execute.

#### You've reached the end of your free preview.

Want to read all 72 pages?

• Fall '19
• Virtual memory