problem with data flow modelling

C

crackle24

Guest
here is the code i wrote to model a decade counter using data flow
modelling.



Entity decade_jk is
Port ( clk: in std_logic;
A: inout std_logic_vector(3 downto 0):="0000");
End decade_jk;

Architecture df_x_decade of decade_jk is

Signal Count : std_logic_vector(3 downto 0):="0000";
Begin
Count <=count + "0001" when clk='1' and clk'event and
count<"1010" else
"0000" when clk='1' and clk'event and count="1001" else
unaffected;
A<=count;

End df_x_decade;

it gives me an error telling me the assignment statement to count is
not right.although the code shows no error when i remove the clk'event
condition but then what happens is that as long as clk is 1 count keeps
incrementing and count increments by 1 even when clk is zero.and the
xilinx version i use does not accept unaffected although it recognises
it as a keyword.
 
crackle24 wrote:

what happens is that as long as clk is 1 count keeps
incrementing and count increments by 1 even when clk is zero.
That is what I would expect, since a concurrent
statement is a process with no wait.

-- Mike Treseler
 
is dere any way 2 solve de problem?
the behavioral model is not a problem.i need 2 write de code using data
flow only.can u please help?
 
Not exactly, since a concurrent assignment statement is an implied
process with an implied sensitivity list made up of all signals on the
left hand side. Therefore there is an implied wait statement on all of
those signals too.

What is happening is that the implied process is sensitive to count
also, so when it increments, it re-triggers the process, incrementing
it again. With the 'event part added, it cannot update the counter
except once per clock.

Andy
 

Welcome to EDABoard.com

Sponsor

Back
Top