Guest
Hi, I have problems with my counter. Sorry for my poor english Register should be reset on the posedge of signal x1 and should be increased on the posedge of CLOCK. I know that register can be changed only in one always process, but I don't know how do that. The error is:
Line 33: Signal register[11] in unit blagam_o_synteze is connected to following multiple drivers:
My code:
module blagam_o_synteze(input x1, input x2,input wire CLOCK,output wire [11:0] DATA);
reg [11:0] register;
reg ENABLE;
initial
begin
register <= 12'd0;
ENABLE <= 1'd0;
end
always @(posedge x1)
begin
ENABLE<=1;
register <= 12'd0;
end
always @(posedge CLOCK)
begin
if(ENABLE==1)
register <= register + 1;
end
always@(posedge x2)
begin
ENABLE<=0;
end
assign DATA[11:0]=register[11:0];
endmodule
Line 33: Signal register[11] in unit blagam_o_synteze is connected to following multiple drivers:
My code:
module blagam_o_synteze(input x1, input x2,input wire CLOCK,output wire [11:0] DATA);
reg [11:0] register;
reg ENABLE;
initial
begin
register <= 12'd0;
ENABLE <= 1'd0;
end
always @(posedge x1)
begin
ENABLE<=1;
register <= 12'd0;
end
always @(posedge CLOCK)
begin
if(ENABLE==1)
register <= register + 1;
end
always@(posedge x2)
begin
ENABLE<=0;
end
assign DATA[11:0]=register[11:0];
endmodule