半加器: //行为级建模 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 进位选择加法…