Implementation of C code for the flow chart?
am not a programmer, so i need help in implementing c code for the flow chart that i have came up for a problem.

problem is switching between two signals, such that signals never gets parallel, i.e. at any instant of time i must allow only one signal at the output. 
**And always preferred signal is s1.**

Here is the algorithm:

 - 1)First read the both signals s1, s2.
 - 2)if both signals are present then stop the signal s2 gate
 - 3)check whether it is stopped are not (by getting feedback signal)?.

 

 - 4)if s2=0, then allow the signal one at output i.e. s1=1.

this way three more cases will arise.

 - s1=0, s2=0; s1=1, s2=0; s1=0, s2=1.

So if possible, someone provide the code for the above algorithm(at least one case is enough so that i can try others.) in C language.
Thanks.

Implementation of C code for the flow chart?
===

am not a programmer, so i need help in implementing c code for the flow chart that i have came up for a problem.

problem is switching between two signals, such that signals never gets parallel, i.e. at any instant of time i must allow only one signal at the output. 
**And always preferred signal is s1.**

Here is the algorithm:

 - 1)First read the both signals s1, s2.
 - 2)if both signals are present then stop the signal s2 gate
 - 3)check whether it is stopped are not (by getting feedback signal)?.

 

 - 4)if s2=0, then allow the signal one at output i.e. s1=1.

this way three more cases will arise.

 - s1=0, s2=0; s1=1, s2=0; s1=0, s2=1.

So if possible, someone provide the code for the above algorithm(at least one case is enough so that i can try others.) in C language.
Thanks.
