0
votes

I was asked the above question the viva of operating systems and my answer that logical address is less than physical address because : Logical Address -is the address visible to the application program -starts from 0 and is contiguous throughout the size of the application program -has Max size equal to length of the application program Physical address - is obtained by adding base register contents to logical address, which gives the virtual address, and then using the page table to obtain the true physical address - has Max length equal to length of physical memory

I was told that the answer is incorrect since the size of virtual address space is greater than that of physical address space.

2

2 Answers

4
votes

The logical address size can be less than, equal to, or greater than physical address size. Real life examples:

  • Less than - A 32 bit application running on a 2014 Mac Book Pro with 16 Gb of memory. Logical addresses are 2^32 in size, physical addresses are 2^34 in size.
  • Equal: A 32 bit application running on a 2012 Mac Book Pro with 4Gb of memory. Both are 2^32 in size.
  • Greater than: An application on a 32 bit Windows system with 512 Mb of memory. Logical address size is 2^32, physical address size is 2^29.
0
votes

Size of logical address can be greater than that of physical address if the size of application program is greater than that of physical memory - Max size of logical address equals size of application program which may be as big as the size virtual memory (which is greater than size of physical memory)

As far as the question asked in the viva is concerned it has no definite answer since in general size of logical address may be greater or less than that of physical address.