`ifdef LV

module CARRY (COUT, ADD1, ADD2, CIN);
    output COUT;
    input  ADD1;
    input  ADD2;
    input  CIN;

and a1 (wire1, ADD1, ADD2);
and a2 (wire2, ADD1, CIN);
and a3 (wire3, ADD2, CIN);
or  o1 (COUT, wire1, wire2, wire3);

endmodule

`else

primitive CARRY ( COUT, ADD1, ADD2, CIN);
    output COUT;
    input  ADD1;
    input  ADD2;
    input  CIN;
    table
          0     0     ?   :  0;
          0     ?     0   :  0;
          ?     0     0   :  0;
          0     1     1   :  1;
          1     1     ?   :  1;
          1     ?     1   :  1;
          ?     1     1   :  1;
    endtable
endprimitive

`endif
