[an error occurred while processing this directive]
|
Но всё равно, ловите:
process (RST, clk_2x)
begin
if RST = '1' then
if (clk_2x'event and clk_2x='1') then
if bit = '1' then
in_register(14 downto 0) <= in_register(13 downto 0) & in_b;
case state is
when idle =>
counter_reset <= '1';
if in_b = '0' then
state <= start;
else
state <= idle;
end if;
when start =>
if in_b = '1' then
state <= data;
counter_reset <= '0';
else
state <= start;
counter_reset <= '1';
end if;
when data =>
if counter(2 downto 0) = "111" then
state <= idle;
counter_reset <= '1';
else
state <= data;
counter_reset <= '0';
end if;
end case;
end if;
end if;
else
in_register <= (others => '0');
counter_reset <= '1';
state <= idle;
end if;
end process;
В общем то алгоритм в лучшем виде я и так Вам описал (см пред-предыдущий мой пост). От этого и отталкивайтесь.
А что я Вам сейчас прислал.... :)
Уж не знаю, куда это засунуть можно. Там много лишних сигналов, использующихся в других автоматах (памятью управлять и проч).
Даже не надеюсь на то, что ЭТОТ кусок Вам поможет.
Кстати, там был "свой" формат слова, поэтому start не воспринимайте в чистом виде.