Half-Adder Example - 2023.1 English

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2023-06-09
Version
2023.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