Welcome to TSDN.
Your question is too much theoritical to explain over here. It is beyond the scope odf this discussion. Please follow a good book for the same or uou can find all there by littler web searching.
Please follow the
posting guidelines in every new post/reply.
Regards
Debasis