Answer for Xor gate
Answer for Multiplexor gate