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.
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.