Let us now examine how this pn junction is created. We all know that there are plenty of holes in p-type semiconductor and plenty of free electrons in the n-type semiconductor. Again in p-type semiconductor there are numbers of trivalent impurity atoms, and ideally, each hole in the p-type semiconductor is associated with one trivalent impurity atom. Here we used the word ideal because we neglect here thermally generated electrons and holes in the crystal. Now if one electron seats on one hole, the impurity atom which was associated that hole now becomes negative ions. Because that now contains an extra electron. As the trivalent impurity atoms accept electrons and becomes negatively charged, the impurity is called acceptor impurity. The impurity atoms replace an equal number of semiconductor atoms in the crystal and place themselves in the crystal structure. Hence, the impurity atoms are statics in the crystal structure. When these trivalent impurity atoms accept free electrons and become negative ions, the ions remain still static. Similarly, when a semiconductor crystal is doped with the pentavalent impurity, each atom of impurity replace semiconductor atom in the crystal structure hence these impurity atoms become static in the crystal structure. Each pentavalent impurity atom in the crystal structure has one extra electron in the outermost orbit which it can easily remove as a free electron. When it removes that electron it becomes positively charged ions. As the pentavalent impurity atoms donate electrons to the semiconductor crystal, the pentavalent impurity is called donor impurity. During discussion of pn junction, we have discussed static acceptor and donor impurity atoms because these play a primary role in the formation of pn junction. Let us come to the point when a p-type semiconductor comes in contact with an n-type semiconductor, free electrons on n-type semiconductor nearer to the junction first migrate to the p-type semiconductor due to diffusion because the concentration of free electrons is much more in the n-type region than that of the p-type region. The electrons come to the p region will combine with holes they first find. That means the free electrons come from n-type region will combine with acceptor impurity atoms nearer to the junction. This phenomenon makes negative ions. As the acceptor impurity atoms nearer the junction in the p-type region, becomes negative ions, there will be a layer of negative static ions in p region adjacent to the junction. It is obvious that the free electrons in the n-type region will migrate first to the p-type region than the free electrons in the n-type region away from the junction. This makes a layer of static positive ions in the n-type region adjacent to the junction. After formation of the sufficiently thick positive ions layer in n-type region and negative ions layer in the p-type region, there will be no more diffusion of electrons from n-type region to p-type region as because there is a negative wall in front of free electrons. These both layers of ions form the pn junction. As one layer is negatively charged and other is positively charged, there will be an electrical potential across the junction and the junction behaves like a potential barrier. The barrier potential depends on the semiconductor material, the amount of doping and temperature. It is found that barrier potential for germanium semiconductor is 0.3 volt at 25oC, and it is for silicon semiconductor 0.7 volt at the same temperature. This potential barrier does not contain any free electron or hole since all free electrons are combined with holes in this region and due to the depletion of charge carriers (electrons or holes) in this region it is also called depletion region. Although diffusion of free electrons and holes stop after the creation of certain thick depletion layer but practically this thickness of depletion layer is very tiny it in a range of micrometers.