Hi,
When i was studying pn Diode i was confused with the ions in p and n substrate. As far as i know these are dopant ions. If so then for p substrate it should be positive ions. Why p has negative ions?
N-type semiconductor has an excess of free electrons compared to the P-type region, and P-type has an excess of holes compared to the N-type region. Therefore when N-doped and P-doped pieces of semiconductor are placed together to form a junction, electrons migrate into the P-side and holes migrate into the N-side. Departure of an electron from the N-side to the P-side leaves a positive donor ion behind on the N-side, and likewise the hole leaves a negative acceptor ion on the P-side. https://en.wikipedia.org/wiki/Depletion_region
Just to be clear, dopants are not ions, and semiconductors are always charge neutral (ideally). When you talk about ions with regards to semiconductors, you're usually talking about other impurities like trapped charges in oxide layers, which are the result of imperfect manufacturing and are not desirable.