I am trying to make a 4-bit adder using the CARRY4 primitive in the 7 series using verilog. The module I wrote was the following:
module fast_4adder(
input wire [3:0] a,
input wire [3:0] b,
input wire c_in,
input wire subtract,
output wire [3:0] sum,
output wire c_out);
wire [3:0] b_sub;
wire [3:0] carry;
wire [3:0] prop;
wire [3:0] gen;
assign b_sub = b ^ {4{subtract}};
assign gen = a & b_sub;
assign prop = a ^ b_sub;
assign c_out = carry[3];
CARRY4 CARRY4_inst(
.CO(carry),
.O(sum),
.CI(1'b0),
.CYINIT(c_in),
.DI(gen),
.S(prop));
endmodule
I found the code for CARRY4 in the "7 series Libraries Guide".
Now I thought this would be implemented in a single slice and use 4 LUT's. But after implementation, it is using 20 LUT's.
Is there a way to make it use the single slice and use the 4 LUT's?