process(clk,reset,current_state,rx_date,ce)
begin
if reset='1' then current_state<=uno;
elsif clk='1' and clk'event then current_state<=next_state;
end if;
case current_state is
when zero=> reset_count<='0';
if rx_date='1' and (ce and not reset)='1' then reset_count<='1';
next_state<=uno;
else next_state<=zero;
end if;
when uno=> reset_count<='0';
if rx_date='0' and (ce and not reset)='1' then reset_count<='1';
next_state<=zero;
else next_state<=uno;
end if;
when others=> reset_count<='0';
next_state<=uno;
end case;
end process;