Download presentation
Presentation is loading. Please wait.
Published byRuth Ferguson Modified over 9 years ago
2
Chapter Two Memory organisation
3
Examples of operating system n Windows 95/98/2000, Windows NT n Unix, Linux, n VAX/VMS IBM MVS n Novell Netware and Windows NT: Client/Server model
4
Objective n how Virtual Memory works; n the limitation and inaccuracy of data n the internal structure between DRAM and Video RAM; and n the function and location of Cache memory.
5
Overlay n Divide the program into several manageable smaller overlays to be stored on the disk n Load the first overlay into the memory and run for a while. n When it finishes, it reads the next overlay into the memory to perform program execution.
6
Idea of virtual memory n Allow programmers to write programs without paying attention to the size of the program n Programs could be as large as necessary n run even though the whole program would not fit into the main memory.
7
Relationship between virtual and physical page
8
Hardware and software n Break program (code + data) into pages (page means fixed length data block.) n Keep all code/data pages on disk n Brings pages from disk into memory only as needed by the programme only.
9
To implement virtual memory, n we must be able to: n break code/data into pages n recognize when a given page is not present in memory n be able to bring the missing page into various places in main memory
10
Difference Between Virtual Address and Physical Address n Compiled addresses are called virtual addresses for this reason. n Physical address refers to the address in the main memory.
11
Mapping n Mapping is about the virtual addresses to physical addresses. n It is composed of two parts, page # and offset n Example in a 16 bit virtual address has: n 4 bit page # (can be changed for different physical frame) n 12 bit offset
12
Addressing n For example 12310h, n The page number is 0011, the first four digits, n The offset is 12310 - 12288 = 22.
13
Address Mapping
14
Virtual to Real addresses n to map one virtual address to several different locations in physical memory.
15
For example 12310 n The page number is 0011 in binary, which is 3 in decimal n The offset is 0000 0001 0110 in binary, which is 22 in decimal n If PAGE 3 was stored in page frame 0, the page is 0 offset = 22
16
Loading data from memory
17
Windows NT n All early PC using 8086 and 80286 used a segmented model. n A segmented addressing system divides physical memory (RAM) into units of continguious address, called segment. n the page size for Windows NT is chosen as 4K bytes
18
Windows NT disk address
19
Memory error Detection /Correction n deals with basic error detection and protection to ensure the data in the memory is accurate n invisible to software; and n set/checked by hardware only
20
3 bit word with parity checking
21
Hamming Codes n Suppose there is an m-bit word, how many extra bits are required to detect and correct the single bit error. n 2^n >= 2m(n + 1) n Since n = m + r n 2^(m+r) >= 2^m (m+r+1) n 2^r >= m + r + 1 n it is more efficient to apply this error checking for large word size but not for small word size.
22
6 bit word with one incorrect
23
Memory Chip Architectures n Main memory n Video memory n Main memory
24
DRAM and SRAM n DRAM uses capacities to hold the data and needs refreshment to store the data as a capacitor
25
Video memory n Video DRAM is a conventional DRAM with an additional 256 bit shift register on board. n This shift register is connected to help download a complete row of memory cells. n The shift register has its own output which can be controlled with separate input lines to the video DRAM.
26
Video RAM
27
Cache Memory n Cache is a French word which means “to hide”. n Cache memory refers to the memory that is invisible. n This helps to speed up the operation.
28
Cache Memory
29
characteristics for cache memory n It is usually built within a CPU/board chip to facilitate the frequently used commands. n Most frequently used code/data in memory is also kept in cache but invisible to software. n When program accesses this code/data, it comes from high speed cache rather than from slower main memory. n Cache memory is small, high speed memory usually on-chip or on same board as CPU.
30
Cache Design n size n how much will fit on a CPU/board? n at what point does increased size result in small improvements in hit rate? Issues
31
Cache Hit
32
Cache Miss
33
Software characteristic n Locality of addressing n Cache contents
34
Hit against cache size
35
Cache Performance n Mean access time = [cache memory access time] + (1-h)*[main memory access time] n h refers to the hit rate n Note that as h -> 0 the cache memory is a little worse than main memory alone.
36
Example n What is the effective memory speed of a cache-main memory system with the following characteristics? n main memory access time is 100 nsec n cache access time is 20 nsec n the hit rate is 95% u Using the formula, the effective memory speed is 20 + (1- 0.95)x100 = 25 nsec
37
Summary n Virtual Memory and Overlay n The memory protection using Hamming code n Cache memory was designed to enhance performance. n To measure how efficient the system is running, hit ratio is used.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.