Professional Documents
Culture Documents
BT3 Tuviet
BT3 Tuviet
use ieee.std_logic_1164.all;
entity fsm_counter4 is
port (
clock : in std_logic;
resetn : in std_logic;
ce : in std_logic;
y : out std_logic;
q : out std_logic_vector(1 downto 0)
);
end fsm_counter4;
process (s_next)
begin
case s_next is
when S0 => q <= "00";
when S1 => q <= "01";
when S2 => q <= "10";
when S3 => q <= "11";
end case;
if s_next = S3 then
y <= '1';
else
y <= '0';
end if;
end process;
end Behavior;