COA-Virtual Memory
COA-Virtual Memory
COA-Virtual Memory
Architecture
Revision:
1. Microprocessor
2. Memory
3. Microcomputer
4. Machine Language
5. Assembly Language
8. Compiler
9. Interpreters
Dynamic RAM
Virtual Memory
In a memory hierarchy system, programs and data are first stored in auxiliary
memory. Portions of a program or data are brought into main memory as
they are needed by the CPU.
Virtual memory is used to give programmers the illusion that they have a
very large memory at their disposal, even though the computer actually has
a relatively small main memory.
A virtual memory system provides a mechanism for translating program-
generated addresses into correct main memory locations.
This is done dynamically, when programs are being executed in the CPU. The
translation or mapping is handled automatically by the hardware by means
of a mapping table.
The term ‘page’ refers to groups of address space of the same size.
Fig. 3
The programs are also considered to be split into pages. Portions of programs
are moved from auxiliary memory to main memory in records equal to the
size of a page. The term "page frame" is sometimes used to denote a block.
The mapping from address space to memory space is facilitated if each
virtual address is considered to be represented by two numbers: a page
number address and a line with the page.
Fig. 4
In a computer with 2^p words per page, p bits are used to specify a line
address and the remaining high-order bits of the virtual address specify the
page number.
In the example of Fig. 3/4, a virtual address has 13 bits. Since each page
consists of 2^10 = 1024 (1K) words, the high order three bits of a virtual
address will specify one of the eight pages and the low-order 10 bits give
the line address within the page. Note that the line address in address
space and memory space is the same; the only mapping required is from a
page number to a block number.
The memory-page table consists of eight words, one for each page. The
address in the page table denotes the page number and the content of the
word gives the block number where that page is stored in main memory.
The table shows that pages 1, 2, 5, ad 6 are now available in main memory
in blocks 3, 0, 1, and 2, respectively.
A presence bit in each location indicates whether the page has been
transferred from auxiliary memory into main memory. A ‘0’ in the
presence bit indicates that this page is not available in main memory.
The content of the word in the memory page table at the page number
address is read out into the memory table buffer register. If the presence
bit is a 1, the block number thus read is transferred to the two high-order
bits of the main memory address register.
The line number from the virtual address is transferred into the low-order
bits of the memory address register. A read signal to main memory
transfers the content of the word to the main memory buffer register
ready to be used by the CPU.
If the presence bit in the word read from the page table is 0, it signifies that
the content of the word referenced by the virtual address does not reside in
main memory. A call to the operating system is then generated to fetch the
required page from auxiliary memory and place it into main memory before
resuming computation.