The XOR (Exclusive-OR) gate is a digital logic gate that outputs HIGH (1) only when the number of HIGH inputs is odd.
For a 2-input XOR gate, the output is HIGH (1) when the inputs are different.
The output is LOW (0) when the inputs are the same
BLOCK DIAGRAM:
module XOR(Y,A,B);
input A,B;
output Y;
assign Y = (A^B);
endmodule
module tb_XOR();
reg A,B;
wire Y;
XOR DUX(Y,A,B);
initial
begin
A=1'b0 ; B=1'b0;
#10 A=1'b0 ; B=1'b1;
#10 A=1'b1 ; B=1'b0;
#10 A=1'b1 ; B=1'b1;
#20 $finish();
end
endmodule
OUTPUT :
Pin Assignment:
Input A = J15
Input B = L16
Output Y = H17