Doped by pentavalent impurities which has 5 valence electrons to produce n-type semiconductors by contributing extra electrons. The addition such as antimony, arsenic or phosphorus contributes free electrons, greatly increasing the conductivity of the intrinsic semiconductor.
This allows four of the five electrons to bond with its neighbouring silicon atoms leaving one "free electron" to move about when an electrical voltage is applied (electron flow).
Doped by trivalent impurities which has 3 valence electrons to produce p-type semiconductors by producing a "HOLE". The addition such as boron, aluminium or gallium to an intrinsic semiconductor creates deficiencies of valence electrons, called "hole".
As there is a hole an adjoining free electron is attracted to it and will try to move into the hole to fill it. However, the electron filling the hole leaves another hole behind it as it moves. This in turn attracts another electron which in turn creates another hole behind, and so forth giving the appearance that the holes are moving as a positive charge through the crystal structure