mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
Fixing concatenation bug
-Don't use concatenation for generators! -Will failt for DW=1
This commit is contained in:
parent
5c0df270c5
commit
76e6cd3c15
@ -14,13 +14,14 @@ module oh_csa42 #( parameter DW = 1 // data width
|
|||||||
input cin,//intra stage carry in
|
input cin,//intra stage carry in
|
||||||
output cout, //intra stage carry out (2x sum)
|
output cout, //intra stage carry out (2x sum)
|
||||||
output [DW-1:0] s, //sum
|
output [DW-1:0] s, //sum
|
||||||
output [DW-1:0] c //carry (2x sum)
|
output [DW-1:0] c //carry (=2x sum)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire [DW-1:0] sum_int;
|
wire [DW-1:0] sum_int;
|
||||||
wire [DW:0] carry_int;
|
wire [DW:0] carry_int;
|
||||||
|
|
||||||
//Edges
|
//Edges
|
||||||
|
assign carry_int[0] = cin;
|
||||||
assign cout = carry_int[DW];
|
assign cout = carry_int[DW];
|
||||||
|
|
||||||
//Full Adders
|
//Full Adders
|
||||||
@ -37,7 +38,7 @@ module oh_csa42 #( parameter DW = 1 // data width
|
|||||||
fa1 (//inputs
|
fa1 (//inputs
|
||||||
.in0(in3[DW-1:0]),
|
.in0(in3[DW-1:0]),
|
||||||
.in1(sum_int[DW-1:0]),
|
.in1(sum_int[DW-1:0]),
|
||||||
.in2({carry_int[DW-1:1],cin}),
|
.in2(carry_int[DW-1:0]),
|
||||||
//outputs
|
//outputs
|
||||||
.c(c[DW-1:0]),
|
.c(c[DW-1:0]),
|
||||||
.s(s[DW-1:0]));
|
.s(s[DW-1:0]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user