Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
else
current_state <= current_state;
ticker <= ticker + 1;
end if;
end if;
end process clkgen_115k2;
tx_control : process (current_state, in_valid, data_counter)
begin
case current_state is
when reset_state =>
accept_in <= '0';
tx <= '1';
next_state <= idle;
when idle =>
accept_in <= '1';
tx <= '1';
if (in_valid = '1') then
next_state <= start_bit;
else
next_state <= idle;
end if;
when start_bit =>
accept_in <= '0';
tx <= '0';
next_state <= send_data;
when send_data =>
accept_in <= '0';
tx <= data_in(conv_integer(data_counter));
if (data_counter = 7) then
next_state <= stop_bit;
else
next_state <= send_data;
end if;
when stop_bit =>
accept_in <= '0';
tx <= '1';
next_state <= idle;
when others =>
accept_in <= '0';
tx <= '1';
next_state <= reset_state;
end case;
end process tx_control;
end architecture behavioural;