16 lines
263 B
Coq
16 lines
263 B
Coq
|
//---------------------------------------
|
||
|
// 1-bit adder
|
||
|
//---------------------------------------
|
||
|
module adder(
|
||
|
input cin,
|
||
|
input a,
|
||
|
input b,
|
||
|
output cout,
|
||
|
output sumout );
|
||
|
|
||
|
|
||
|
assign sumout = a ^ b ^ cin;
|
||
|
assign cout = (a & b) | ((a | b) & cin);
|
||
|
|
||
|
endmodule
|