The introduction of an impurity into the crystal lattice of a semiconductor to modify its electrical properties by creating a concentration of N or P carriers.