XOR gate and its application in staircase light control