Number of bits for physical address = Number of bits to represent frames+Number of bits to represent bytes per frame size.

Here, number of page frames = 32, and frame size is the same as page size which is 512 bytes.32 = 25. So, number of bits to represent frames = 5.512=29. So, number of bits to represent bytes per frame size = 9.So, the number of bits for physical address = 5 + 9 = 14.Therefore, the number of bits required in logical and physical address are 15 and 14 respectively.So, the correct answer is 3.