(i) During the formation of p-n junction, the holes diffuse from p-type semiconductor to the n-type, and electrons diffuse from n-type to p-type. This is because of the concentration gradient across p-side and n-side.
When a hole diffuses from p to n type, it leaves an unmovable negative charge. Similarly, when an electron diffuses from n to p type, it leaves an unmovable positive charge. When the diffusion of holes and electrons takes place continuously across the junction, a layer of unmovable positive and negative charges are developed on either side of the junction. This layer is called the depletion layer or the depletion region and the potential difference across the region is called the barrier potential.
(ii) Half wave rectifier :
When an input ac voltage is applied across the primary coil, a potential difference is developed across the ends of the secondary coil. Consider that in half cycle of input ac signal, the end A acts as the +ve end and B acts as the -ve end of the battery. so, the diode is in forward bias and we get output across the ends of the load resistance
RL.
In the second half cycle, ends A and B reverse in polarity. Now, A acts as the -ve end and B acts as the +ve end. So, the diode D is in reverse bias and no output is obtained due to the high resistance offered by the diode.
So, in this process, we get output alternately, and hence the diode is called the half wave rectifier.