cc_inc4.v
885 Bytes
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: cc_inc4
// description: 4 bit incrementer, with carry in and out.
//
// designer: Phil Gossett
// date: 6/26/94
//
////////////////////////////////////////////////////////////////////////
module cc_inc4 (a, ci, co, s);
input [3:0] a;
input ci;
wire [2:0] c;
output co;
output [3:0] s;
xo02d1h xos0 (.a1(ci), .a2(a[0]), .z(s[0]));
an02d1h anc0 (.a1(ci), .a2(a[0]), .z(c[0]));
xo02d1h xos1 (.a1(c[0]), .a2(a[1]), .z(s[1]));
an02d1h anc1 (.a1(c[0]), .a2(a[1]), .z(c[1]));
xo02d1h xos2 (.a1(c[1]), .a2(a[2]), .z(s[2]));
an02d1h anc2 (.a1(c[1]), .a2(a[2]), .z(c[2]));
xo02d1h xos3 (.a1(c[2]), .a2(a[3]), .z(s[3]));
an02d1h anca (.a1(c[0]), .a2(a[1]), .z(ca));
an02d1h ancb (.a1(c[1]), .a2(a[2]), .z(cb));
an02d1h anco (.a1(ca), .a2(cb), .z(co));
endmodule // cc_inc4