Formation Of Barrier Potential In Pn Junction