There are errors in the first two answers (PVRK and TK) above.
All impurities are not dopants! An impurity has to fulfill several conditions to qualify as a dopant (donor or acceptor). Also, all impurities in silicon are not ionised at room temperature; the dopants are ionised only when kT is of the order of the dopant ionisation energy.
In p-type semiconductors, the Fermi level lies above the acceptor level (but, below the intrinsic level), so that the acceptors are ionised according to the Fermi-Dirac probability function. Similarly, in n-type semiconductor, the Fermi level lies below the donor level (but, above the intrinsic level), so that the donors are ionised according to the Fermi-Dirac probability function.
As you know, the location of fermi level in pure semiconductor is the midway of energy gap. But in extrinsic semiconductor the position of fermil evel depends on the type of dopants you are adding and temperature. In n-type materials, at low temperatures, the femilevel will be midway of bottom of conduction band and donar level. In p-type materials, at low temperatures, the fermilevel is the midway of top of valence band and acceptor levels. In both the cases as the temperature increases fermilevel shifts towards midway of energy gap.
As you are being a engineering student, for the easy understanding of this, you can refer Engineering Physics by Avadhanulu and Kshirsagar. For more details you can also refer, Solid state Physics by Charles Kittel.This book might be bit difficult you to understand.
The two books suggested before me are very good. Ashcroft & Mermin also have a chapter on this issue. The book by S. O. Kasap (Principles of electronic materials and devices) is probably the most didactic and easy-reading material that I know on this subject.
A quick and dirty answer to your question is this formula:
EF = EF,i + ½ × kT × ln(n/p)
Where k is the Boltzman constant, T the temperature (K), n,p the electron and hole concentration and EF,i the intrinsic Fermi level position given by:
EF,i = EV + ½ Eg + (3/4) × ln(mh*/me*)
Where EV is the valence band edge (reference energy), Eg the bandgap, and m* the effective mass of the electrons (e) or holes (h). For common semiconductors it is often plausible to assume that the intrinsic Fermi level is at midgap.
Note that n,p are not necessarily the dopant concentrations. The are the electron and hole concentrations, which may differ from the doping levels is they are not fully ionized.
There are errors in the first two answers (PVRK and TK) above.
All impurities are not dopants! An impurity has to fulfill several conditions to qualify as a dopant (donor or acceptor). Also, all impurities in silicon are not ionised at room temperature; the dopants are ionised only when kT is of the order of the dopant ionisation energy.
In p-type semiconductors, the Fermi level lies above the acceptor level (but, below the intrinsic level), so that the acceptors are ionised according to the Fermi-Dirac probability function. Similarly, in n-type semiconductor, the Fermi level lies below the donor level (but, above the intrinsic level), so that the donors are ionised according to the Fermi-Dirac probability function.
the answers provided here are right. If still u have some clarifications, you can refer to the physics of semiconductors by Neamann or Solid state devices & technology by Das Gupta