verilog/iverilog/tobb/lab3/fulladder.v
2024-12-12 01:05:57 +03:00

14 lines
295 B
Verilog

module fulladder (
input A, B, CarryIn,
output Sum, CarryOut
);
wire AandB, AxorB, ABandCIn;
halfadder h1 (.A(A),.B(B),.Sum(AxorB), .CarryOut(AandB));
halfadder h2 (.A(AxorB), .B(CarryIn), .Sum(Sum), .CarryOut(ABandCIn));
or o1 (CarryOut, AandB, ABandCIn);
endmodule