How are p-type and n-type semiconductor obtained?
A P-type semiconductor is attained by carrying out a process of doping which is adding a certain type of atoms to the semiconductor in order to increase number of free charge carriers (in this case positive). Purpose of P-type doping is to create an abundance of holes.
When doping material is added, it takes away (accepts) weakly-bound outer electrons from semiconductor atoms. This kind of doping agent is also called as acceptor material and the semiconductor atoms that have lost an electron are termed as holes.
An N-type semiconductor is attained by carrying out a process of doping, that is, by adding an impurity of valence-five elements to a valence-four semiconductor in order to increase number of free charge carriers (in this case negative). Purpose of N-type doping is to produce an abundance of mobile or "carrier" electrons in the material.