0% found this document useful (0 votes)
69 views5 pages

Logical Address

The document discusses logical addresses, physical addresses, and the mapping between them. It defines key terms: - Logical addresses are generated by the CPU and refer to virtual memory locations, while physical addresses identify actual locations in RAM. - The logical address space is divided into pages, while the physical address space is divided into frames of the same size. - The memory management unit (MMU) maps pages to frames, translating logical addresses to physical addresses. This allows programs to access virtual memory without knowing physical locations. - Swapping moves processes between RAM and disk storage as needed to optimize memory usage when processes are idle or blocked. This allows more processes to run than could fit entirely in RAM.

Uploaded by

anjali gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views5 pages

Logical Address

The document discusses logical addresses, physical addresses, and the mapping between them. It defines key terms: - Logical addresses are generated by the CPU and refer to virtual memory locations, while physical addresses identify actual locations in RAM. - The logical address space is divided into pages, while the physical address space is divided into frames of the same size. - The memory management unit (MMU) maps pages to frames, translating logical addresses to physical addresses. This allows programs to access virtual memory without knowing physical locations. - Swapping moves processes between RAM and disk storage as needed to optimize memory usage when processes are idle or blocked. This allows more processes to run than could fit entirely in RAM.

Uploaded by

anjali gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Logical Address

• It is generated by CPU while a program is running.


• The logical address is virtual address as it does not exist physically, therefore, it is
also known as Virtual Address.
• The set of all logical addresses generated by a programs perspective is called Logical
Address Space.

Logical Address Space


• The Logical address space is also splitted into fixed-size blocks, called pages.

Physical Address
• It identifies a physical location of required data in a memory. The user never directly
deals with the physical address but can access by its corresponding logical address.
• The set of all physical addresses corresponding to the logical addresses in a Logical
address space is called Physical Address Space.

Physical Address Space


• The Physical Address Space is conceptually divided into a number of fixed-size
blocks, called frames.

Mapping virtual-address to physical-address


Difference between Logical Address & Physical Address

Parameter Logical Address Physical Address

Basic Generated by CPU Location in a memory unit

Logical Address Space is set


Physical Address is set of all physical
of all logical addresses
Address Space addresses mapped to the
generated by CPU in
corresponding logical addresses.
reference to a program.

User can view the logical User can never view physical address
Visibility
address of a program. of program.

Generation Generated by the CPU Computed by MMU

The user can use the logical


The user can indirectly access physical
Access address to access the
address but not directly.
physical address.

Swapping
• Swapping is one of the methods of memory management.
• In swapping an idle or a blocked process in the main memory is swapped out to the
backing store (disk) and the process that is ready for execution in the disk, is
swapped in main memory for execution.
• Consider a real-time example:
• In Windows operating system, as soon as the system is booted 50-100 process starts
executing, these processes do nothing but check for application updates. Such
processes take up to 5-10 MB memory space. The other processes start checking for
the incoming network, incoming mails and the other things.
• This all happens before a user has started any process. A single user application
nowadays takes about 500 MB of memory space just to start up. So keeping all these
processes in main memory would require a large amount of main memory. And the
increasing the size of main memory would increase the cost of the system. To deal
with these memory overloads we have come up with the two
approaches, swapping and virtual memory.
• A process must be in the main memory before it starts execution. So, a process that
is ready for execution is brought in the main memory. Now, if a running the process
gets blocked. The memory manager temporarily swaps out that blocked process on
to the disk. This makes the space for another process in the main memory.

Paging
 Paging is a memory management scheme that eliminates the need for
contiguous allocation of physical memory. This scheme permits the
physical address space of a process to be non – contiguous.

Some Important Terminologies


The mapping from virtual to physical address is done by the memory
management unit (MMU) which is a hardware device and this mapping is
known as paging technique.
 The Physical Address Space is conceptually divided into a number of fixed-
size blocks, called frames.
 The Logical Address Space is also splitted into fixed-size blocks, called pages.
 Page Size = Frame Size
Questions:
1. If Logical Address = 31 bit, then Logical Address Space = 231 words = 2
G words (1 G = 230)

2. If Logical Address Space = 128 M words = 27 * 220 words, then Logical


Address = log2 227 = 27 bits

3. If Physical Address = 22 bit, then Physical Address Space = 222 words =


4 M words (1 M = 220)

4. If Physical Address Space = 16 M words = 24 * 220 words, then Physical


Address = log2 224 = 24 bits

5. Physical Address = 12 bits, then Physical Address Space = 4 K words

6. Logical Address = 13 bits, then Logical Address Space = 8 K words

7. Page size = frame size = 1 K words (assumption)

Address generated by CPU is divided into


 Page number(p): Number of bits required to represent the pages in Logical
Address Space or Page number
 Page offset(d): Number of bits required to represent particular word in a page
or page size of Logical Address Space or word number of a page or page
offset.
Physical Address is divided into
 Frame number(f): Number of bits required to represent the frame of Physical
Address Space or Frame number.
 Frame offset(d): Number of bits required to represent particular word in a
frame or frame size of Physical Address Space or word number of a frame or
frame offset.

You might also like