Im on cell phone so I can't type details.

Use IF statement to check if input pins are 1 or 0, then turn on output as desired.


Check manual, must have example.