P
Pleg
Guest
Hi everybody, I'm sure I'm doing some stupid error but I can't find it.
It's very simple: I have a FSM that, sometimes, asserts the signal
"ths_counter_updater" to 1 for one clock cycle. I have another process which
is supposed to get that '1' and change the signal "ths_sig_internal"
according to this rule: starting from 0, count up until2, then stay there
(0->1, 1->2, 2->2, 3 is an error). I've written this code:
updating: process(clock)
begin
if((clock'event and clock='1') and (ths_counter_updater='1')) then
case ths_sig_internal is
when B"00" => ths_sig_internal <= B"01";
when B"01" => ths_sig_internal <= B"10";
when B"10" => ths_sig_internal <= B"10";
when others => ths_sig_internal <= B"11";
end case;
end if;
end process updating;
The signals are declared as
signal ths_sig_internal: std_logic_vector(1 downto 0) := B"00";
signal ths_counter_updater: std_logic:='0';
It doesn't work: the first time "ths_sig_internal" goes to 1,
"ths_sig_internal" goes from "00" to "0X", the second time it goes to "XX"
and stays so forever.
Can anybody help me, please?
Pleg
It's very simple: I have a FSM that, sometimes, asserts the signal
"ths_counter_updater" to 1 for one clock cycle. I have another process which
is supposed to get that '1' and change the signal "ths_sig_internal"
according to this rule: starting from 0, count up until2, then stay there
(0->1, 1->2, 2->2, 3 is an error). I've written this code:
updating: process(clock)
begin
if((clock'event and clock='1') and (ths_counter_updater='1')) then
case ths_sig_internal is
when B"00" => ths_sig_internal <= B"01";
when B"01" => ths_sig_internal <= B"10";
when B"10" => ths_sig_internal <= B"10";
when others => ths_sig_internal <= B"11";
end case;
end if;
end process updating;
The signals are declared as
signal ths_sig_internal: std_logic_vector(1 downto 0) := B"00";
signal ths_counter_updater: std_logic:='0';
It doesn't work: the first time "ths_sig_internal" goes to 1,
"ths_sig_internal" goes from "00" to "0X", the second time it goes to "XX"
and stays so forever.
Can anybody help me, please?
Pleg