full_adder_1.v
上传用户:saul_905
上传日期:2013-11-27
资源大小:184k
文件大小:0k
源码类别:
VHDL/FPGA/Verilog
开发平台:
Visual C++
- module full_adder(a,b,cin,out,carry);
- input a,b,cin;
- output out,carry;
- reg out,carry;
- reg t1,t2,t3;
- always@
- (a or b or cin)begin
- out = a^b^cin;
- t1 = a&cin;
- t2 = b&cin;
- t3 = a&b;
- carry = t1|t2|t3;
- end
- endmodule