2-Input XOR Function Example - 2022.1 English

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2022-06-06
Version
2022.1 English

In this coding example, each instance of the built-in modules has a unique instantiation name such as a_inv, b_inv, and out.

module build_xor (a, b, c);

input a, b;

output c;

wire c, a_not, b_not;

 

not a_inv (a_not, a);
not b_inv (b_not, b);
and a1 (x, a_not, b);
and a2 (y, b_not, a);
or out (c, x, y);

endmodule