Create a full adder. A full adder adds three bits (including carry-in) and produces a sum and carry-out.
译:
创建一个全加器。全加器将三个比特相加(包括进位输入),并产生一个和与进位输出。
个人解法:
module top_module(
input a, b, cin,
output cout, sum );
assign {cout,sum}=a+b+cin;
endmodule
运行结果: