// UDP for full-adder carry-out function primitive coutprm (cout, a, b, cin); output cout; input a, b, cin; // Truth table for the carry-out function table // a b cin : cout 0 0 0 : 0; 0 0 1 : 0; 0 1 0 : 0; 0 1 1 : 1; 1 0 0 : 0; 1 0 1 : 1; 1 1 0 : 1; 1 1 1 : 1; endtable endprimitive // UDP for full-adder sum function primitive sumprm (sum, a, b, cin); output sum; input a, b, cin; // Truth table for the sum function table // a b cin : sum // PUT YOUR EIGHT LINES OF CODE HERE endtable endprimitive // Model a full-adder module fadd (cout, sum, a, b, cin); output cout, sum; input a, b, cin; wire a, b, cin; //Not necessary default type is wire wire cout, sum; //Not necessary default type is wire coutprm u1 (PUT PROPER NETLIST HERE); sumprm u2 (PUT PROPER NETLIST HERE); endmodule // Testbench for full-adder module testfadd; reg a, b, cin; wire cout, sum; fadd u1 (cout, sum, a, b, cin); initial begin $stop; #10; a=1'b0; b=1'b0; cin=1'b0; #10; a=1'b0; b=1'b0; cin=1'b1; #10; a=1'b0; b=1'b1; cin=1'b0; #10; a=1'b0; b=1'b1; cin=1'b1; #10; a=1'b1; b=1'b0; cin=1'b0; #10; a=1'b1; b=1'b0; cin=1'b1; #10; a=1'b1; b=1'b1; cin=1'b0; #10; a=1'b1; b=1'b1; cin=1'b1; #10; $stop; end endmodule