半加器:
//行为级建模 module half_adder2(a, b, sum, c_out); input a, b; output sum, c_out; assign {c_out, sum} = a + b; endmodule
// 结构级建模 module half_adder(a, b, sum, c_out); input a, b; output sum, c_out; xor (sum, a, b); and (c_out, a, b); endmodule
原文:https://www.cnblogs.com/lizhiqing/p/11912063.html