2021-03-16 19:04:31 -05:00
|
|
|
//---------------------------------------
|
|
|
|
// 1-bit adder
|
|
|
|
//---------------------------------------
|
2023-06-20 18:57:08 -05:00
|
|
|
(* abc9_box, lib_whitebox *)
|
2021-03-16 19:04:31 -05:00
|
|
|
module adder(
|
2023-06-20 19:09:31 -05:00
|
|
|
output sumout,
|
|
|
|
output cout,
|
|
|
|
input a,
|
|
|
|
input b,
|
|
|
|
input cin
|
|
|
|
);
|
|
|
|
assign sumout = a ^ b ^ cin;
|
|
|
|
assign cout = (a & b) | ((a | b) & cin);
|
2021-03-16 19:04:31 -05:00
|
|
|
|
|
|
|
endmodule
|