Wanted to know how should i be processing the information of converting the virtual address
(0x10002400)
which contains the value floor(n/2^10) to physical address
Details given are 32 bit address bus 512 KB physical memory and page size of 32 KB
Contents of a memory location does not impact the virtual to physical address translation.
Your virtual address got 8 hex values, which indicates this is a 32 bit virtual address. Your physical memory size is 512KB, which means there are 2^19 bytes (512 * 1024 Bytes). In this case, virtual to physical mapping involves mapping a 32 bit address to a 19 bit address. In your example, the page size is 32KB, which means there are 16 physical pages (512/32). We need 4 bits to index 16 physical pages. From the 32 bit virtual address, we use the last 4 bits to index into a physical page. We can use the remainder 28 bits to do the comparison. There is an structure called "page table" which holds this information. This is basically a mapping of leading 28 bits (32-4) of the virtual address to the leading 15 bits (19-4) physical address.
In the given example, the virtual address is 0x10002400. Last 4 bits are represented by hex 0. Therefore the index is 0. So we take the 0th entry from the page table. Then we check if the virtual tag in the page table matches with our virtual tag which is 1000240 (Note: The last hex value is dropped). If the virtual tag in the entry matches 1000240, then we use the physical tag from the 0th entry and construct our physical address by appending the same index, which is zero.