Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/74_cmp.v b/74_cmp.v
- index 63c463a..19020d8 100644
- --- a/74_cmp.v
- +++ b/74_cmp.v
- @@ -13,11 +13,12 @@ output [Y_WIDTH-1:0] Y;
- wire _TECHMAP_FAIL_ = A_WIDTH <= 3 && B_WIDTH <= 3;
- -localparam WIDTH = ((Y_WIDTH + 3) / 4) * 4;
- +localparam MAX_WIDTH = (A_WIDTH > B_WIDTH) ? A_WIDTH : B_WIDTH;
- +localparam WIDTH = ((MAX_WIDTH + 3) / 4) * 4;
- -wire [Y_WIDTH-1:0] A_buf, B_buf;
- -\$pos #(.A_SIGNED(A_SIGNED), .A_WIDTH(A_WIDTH), .Y_WIDTH(Y_WIDTH)) A_conv (.A(A), .Y(A_buf));
- -\$pos #(.A_SIGNED(B_SIGNED), .A_WIDTH(B_WIDTH), .Y_WIDTH(Y_WIDTH)) B_conv (.A(B), .Y(B_buf));
- +wire [MAX_WIDTH-1:0] A_buf, B_buf;
- +\$pos #(.A_SIGNED(A_SIGNED), .A_WIDTH(A_WIDTH), .Y_WIDTH(MAX_WIDTH)) A_conv (.A(A), .Y(A_buf));
- +\$pos #(.A_SIGNED(B_SIGNED), .A_WIDTH(B_WIDTH), .Y_WIDTH(MAX_WIDTH)) B_conv (.A(B), .Y(B_buf));
- wire [WIDTH-1:0] AA = A_buf;
- wire [WIDTH-1:0] BB = B_buf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement