function integer round_up2;
input integer N;
begin
- round_up2 = ((N / 2) + 1) * 2;
+ round_up2 = ((N + 1) / 2) * 2;
end
endfunction
);
assign CO[i] = (AA[i] && BB[i]) || (C[i] && (AA[i] || BB[i]));
- if (i < Y_WIDTH) begin
+ if (i+1 < Y_WIDTH) begin
assign CO[i+1] = FCO[i];
assign Y[i+1] = Y1[i];
end
wire muxwck = (WCKMUX == "INV") ? ~WCK : WCK;
- wire muxwre = (WREMUX == "1") ? 1'b1 :
- (WREMUX == "0") ? 1'b0 :
- (WREMUX == "INV") ? ~WRE :
- WRE;
+ reg muxwre;
+ always @(*)
+ case (WREMUX)
+ "1": muxwre = 1'b1;
+ "0": muxwre = 1'b0;
+ "INV": muxwre = ~WRE;
+ default: muxwre = WRE;
+ endcase
+
always @(posedge muxwck)
if (muxwre)
wire muxwck = (WCKMUX == "INV") ? ~WCK : WCK;
- wire muxwre = (WREMUX == "1") ? 1'b1 :
- (WREMUX == "0") ? 1'b0 :
- (WREMUX == "INV") ? ~WRE :
- WRE;
+ reg muxwre;
+ always @(*)
+ case (WREMUX)
+ "1": muxwre = 1'b1;
+ "0": muxwre = 1'b0;
+ "INV": muxwre = ~WRE;
+ default: muxwre = WRE;
+ endcase
always @(posedge muxwck)
if (muxwre)
integer i;
initial begin
for (i = 0; i < 15; i = i + 1) begin
- ram[i] = conv_initval[4*i +: 4];
+ ram[i] <= conv_initval[4*i +: 4];
end
end
parameter SRMODE = "LSR_OVER_CE";
parameter REGSET = "RESET";
- wire muxce = (CEMUX == "1") ? 1'b1 :
- (CEMUX == "0") ? 1'b0 :
- (CEMUX == "INV") ? ~CE :
- CE;
+ reg muxce;
+ always @(*)
+ case (CEMUX)
+ "1": muxce = 1'b1;
+ "0": muxce = 1'b0;
+ "INV": muxce = ~CE;
+ default: muxce = CE;
+ endcase
wire muxlsr = (LSRMUX == "INV") ? ~LSR : LSR;
wire muxclk = (CLKMUX == "INV") ? ~CLK : CLK;