PROCESS (sensitivity list) IS
BEGIN
-- sequential statements
END PROCESS;
architecture Behavior of example is
-- Define a custom type to enumerate the states
type state_type is (yes, no);
-- Instantiate a signal of that type to hold the state
signal currState : state_type;
begin
-- Begin a process block so that statements are interpreted sequentially
process (clock)
begin
-- On rising clock edges...
if rising_edge(clock) then
-- Based on the current state...
case currState is
when yes =>
-- Define the next state based on the input(s)
if B = '1' then
currState <= no;
else currState <= yes;
end if;
when no =>
if B = '1' then
currState <= yes;
else currState <= no;
end if;
end case;
end if;
end process;
-- Define output(s)
Y <= '1' when currState = yes else '0';
N <= '1' when currState = no else '0';
end Behavior;