module full_adder (
    input wire a,
    input wire b,
    input wire cin,
    output wire sum,
    output wire cout
);
    // Sum is the XOR of the three inputs
    assign sum = a ^ b ^ cin;
    // Carry out is the majority function of the three inputs
    assign cout = (a & b) | (b & cin) | (cin & a);
endmodule