Two electrons are transferred from the calcium atom, one to each chlorine atom. Calcium becomes a +2 ion and each chlorine becomes a -1 ion. The +2 calcium ion and the two -1 chloride ions attract ...
In the n-type layer, there is an excess of electrons, and in the p-type layer, there is an excess of positively charged holes (which are vacancies due to the lack of valence electrons ... now contains ...