Half-Adder Example - 2022.1 English

Vivado Design Suite User Guide: Synthesis (UG901)

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

This coding example shows the structural description of a half-Adder composed of four, 2-input nand modules.

module halfadd (X, Y, C, S);

input X, Y;

output C, S;

wire S1, S2, S3;

 

nand NANDA (S3, X, Y);
nand NANDB (S1, X, S3);
nand NANDC (S2, S3, Y);
nand NANDD (S, S1, S2);
assign C = S3;

endmodule