Is there a relation between Gap energy and Fermi energy? Are Gap energy and Fermi energy in semi conductors co-dependent variables? If yes, what's the relationship between them?
 A: The bandgap energy is the difference between two levels, the valence band edge and the conduction band edge.
The Fermi level is a particular energy level, the level at which, if there were a state at that level, the state would have a 50% probability of occupancy.
In order for a material to be considered a semiconductor, the Fermi level must lie within the band gap. That is, somewhere between the valence band edge and the conduction band edge. So you could write a relationship
$$ 0 < E_f - E_v < E_g$$
where $E_v$ is the maximum energy level in the valence band.
Typically in intrinsic semiconductors, the Fermi level is quite close to the middle of the band gap. This is a consequence of the detailed balance requirement and the valence and conduction bands' E-k relationships not having too different a curvature.
When doping is introduced, it tends to shift the Fermi level towards one band edge or the other. With degenerate doping, the Fermi level may actually move below the valence band edge or above the conduction band edge.
A: The simple approximation is $ E_F = \frac{E_c - E_v}{2} $ in undoped semiconductor but it should be noticed that Fermi levels change with dopant e.g.  $ E_F = \frac{E_c - E_v}{2} +\frac{1}{2} kT \ln{\frac{N_v}{N_c}}. $
