Archived
1
0
This repository has been archived on 2026-02-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
iceberg/gates/predefined/xor_gate.v
T
2022-02-28 23:53:53 +01:00

15 lines
306 B
Verilog

include "and_gate.v"
include "or_gate.v"
include "not_gate.v"
module xor_gate(y, a, b);
input a, b;
output y;
wire selA, selB, tmpOrA, tmpOrB;
not_gate(a, selA);
not_gate(b, selB);
and_gate(a, selB, tmpOrA);
and_gate(selA, b, tmpOrB);
or_gate(tmpOrA, tmpOrB, y);
endmodule