The XOR gate ( Exclusive OR ) is a logic gate that outputs 1 ( true ) when exactly one of its inputs is 1 ( true ) . A true output ( 1 ) results if one , and only one , of the inputs to the gate is true ( 1 ) .