Concept Of Address Split in OS
Last Updated :
16 Jan, 2020
In OS we have two kind of addresses: Virtual/Logical Address, and Physical Address.
Virtual or Logical Address:
It is generated by the CPU.The meaning of the previous sentence is that our systems are designed so that CPU utilisation should be maximum and thus to use the CPU properly we sort to use multiprogramming. Due to Multiprogramming it is not that only complete process is loaded into the main memory, instead many different number of processes may be present in the main memory . And when each of this processes are loaded to CPU the CPU thinks that only process in present in the main memory. Thus, it produces Addresses relative to 0, it means that CPU starts treating the process as if it is loaded to memory location 0 in the main memory. Thus, for every process (during context switch) CPU would produce address relative to 0.
Now each of the process is divided into pages of equal length and in return each page consists of fixed number of words.
To keep track of which pages are loaded where in Main Memory we use a Page Table. The number of page table entries is equal to number of pages. Just like array index the indices represent the Page number and respective content would hold the location where the Page is actually Loaded in the Main Memory. Some times even the page we need might not be present in the Page Table thus Page Miss occurs and in that case we need to Fetch the page from the secondary memory.
Physical Address:
As explained above that CPU generates addresses of all the processes in the main memory relative to zero i.e., CPU produces address starting from 0.Now the addresses generated by are no way real because if those addresses were valid then all processes would begin from zero and rest spaces in Main Memory would be memory. Thus the addresses generated by CPU should be some way mapped to real (physical address) of the Main Memory. This is done by MMU (Memory Management unit).

Now we usually divide the Main Memory in to Frames of equal sizes.And in return each of the Frame consists of equal number of words.
Important Point to be noted is that Page Size = Frame Size.
Note:
The smallest addressable unit in memory is called word. It means the smallest unit which can specifically identified using address bits.
The Address Space of Virtual Address is divided into 2 parts: Page Number, and Page OFFset.
Similarly, the Address Space of Physical Address is divided into 2 parts: Frame Number, and Frame OFFset.
Let Virtual Address has n bits and Physical Address has m bits.
Page Size = Frame Size = k bits
(as page size = Frame size as mentioned above).
Number of Pages = 2(n-k) pages

Number of Frames = 2(m-k) Frames

And, number of word in each page/frame = 2(k) pages.
Thus in both the addressing schemes last k bits are reserved to find the particular word.Left n-k bits are used to find the Page number from all the set of page numbers and in case of frame the rest m-k bits are used to find out the particular frame from all the set of frame numbers.
In simple terms I can explain here that of n bits in Virtual Address n-k bits are find the particular page number in page table and m-k bits of m bits of Physical Address are used to find the particular frame and after find the particular frame we need to go to particular word containing the required data (since word is the smallest addressable unit) so the k bits are used to find that particular.
Trick:
Consider a n bit address space then if k bits are used to define number of blocks in that address space the rest n-k bits are used to find a specific block along that chosen block using the k bits. This would be clear from the below block diagram.

This same concept can be extended also in Computer Networks.
Note:
Word addressable and byte addressable concept are different, when in question ask about word addressable convert the address space in to words and then apply the all the above explained concepts.
Similar Reads
Types of Three-address codes
Three-address code is a sequence of statements of the general form A := B op C, where A, B, C are either programmer defined names, constants or compiler-generated temporary names; op stands for an operation which is applied on A, B.In simple words, a code having at most three addresses in a line is
2 min read
IPv6 Addressing Format and Conventions
As more devices connect to the internet every day, then the old IPv4 system canât keep up with the need for unique addresses. Thatâs where IPv6 comes in use which offers a much larger number of addresses and better network features. We know that IPv4 addresses are mostly represented in a dotted deci
5 min read
Printing the Address of an Object of Class in C++
Prerequisite: Classes and Objects in C++ The location of an object in the memory is called its address. Addressing is a necessary part of C++, it enables us to use any element as a reference and maintains the uniqueness of all the elements whether it is any variable, object, or container. In this ar
3 min read
Three address code in Compiler
TAC is an intermediate representation of three-address code utilized by compilers to ease the process of code generation. Complex expressions are, therefore, decomposed into simple steps comprising, at most, three addresses: two operands and one result using this code. The results from TAC are alway
6 min read
Structure and Types of IP Address
IP addresses are an important part of the Internet. It can be represented as Internet Protocol address. A unique address that identifies the device over the network. They are made up of a series of numbers or alphanumeric characters that help us to identify devices on a network. Almost every device
8 min read
Introduction to Address Descriptor
What is Address Descriptor?An address descriptor is a data structure that provides information about an address in a computer's memory. The address descriptor is used by the operating system and runtime system to manage access to different regions of memory. It allows the operating system to set up
4 min read
Virtual Address Space in Operating System
In operating systems, Virtual memory plays a very vital role, in managing the memory allotted to different processes and efficiently isolating the different memory addresses. The role of the virtual address is to assign a space to the ledger of all the virtual memory areas that are provided to diffe
5 min read
Address Binding and its Types
Address Binding is the mapping of a physical address to a logical address known as a virtual address, it allocates a physical memory region to a logical pointer. In this article, We are going to cover address binding with the help of an example and Its types like compile time, load time, and executi
5 min read
Different Types of System Calls in OS
System calls are interfaces provisioned by the operating system to allow user-level applications to interact with low-level hardware components & make use of all the services provided by the kernel, which is a core component and the heart of an operating system that manages all the hardware and
10 min read
Logical and Physical Address in Operating System
A logical address is generated by the CPU while a program is running. The logical address is a virtual address as it does not exist physically, therefore, it is also known as a Virtual Address. The physical address describes the precise position of necessary data in a memory. Before they are used, t
5 min read