when DC supply is given to ATmega16 micro-controller, I want it to continue functioning from the same state, from where it was stopped
As a practical matter you cannot do this. In order to accomplish what you want it would be necessary to save every register in the processor and every RAM location to some kind of non-volatile memory every time something changes, and then somehow reload all of the registers and RAM from the non-volatile memory when power is restored. You would also need to make sure that the processor didn't lose power while it was in the middle of doing this copying, otherwise you end up with a bizarre state in the non-volatile memory. It would be a good idea to add error checking to make sure you saved a valid image...and all of this must be done after every instruction is executed.

A more reasonable option is to add some kind of battery backup, then detect when the main power is falling and move the processor to a low-power state.