J
Jesper
Guest
I'm trying to play around with Xilinx CPLD and make a simple frequency
counter.
I'm trying to do this :
--------------------------
always @(posedge reset)
q <= 0;
always @(posedge clk)
begin
q <= q + 1;
end
------------------------
But get an error about Multi-Source on q bla bla
I understand WHY I get the error, but I don't see how I should write
this to avoid the problem.
clk is the unknown frequency input and reset is a 1 second signal from
the timebase. There's a little more to it that this, but it illustrates
the problem.
I cannot have both reset and clk in the same "always" and do "if
(reset)", because the reset need to be on the flank of the reset signal,
not on the level.
Any help to a confused noob much apreciated.
counter.
I'm trying to do this :
--------------------------
always @(posedge reset)
q <= 0;
always @(posedge clk)
begin
q <= q + 1;
end
------------------------
But get an error about Multi-Source on q bla bla
I understand WHY I get the error, but I don't see how I should write
this to avoid the problem.
clk is the unknown frequency input and reset is a 1 second signal from
the timebase. There's a little more to it that this, but it illustrates
the problem.
I cannot have both reset and clk in the same "always" and do "if
(reset)", because the reset need to be on the flank of the reset signal,
not on the level.
Any help to a confused noob much apreciated.