then
q<=q+1;
end if;
end procESS ;
clk1x<=q(3);
process(clk16x,i,serialin,rst) --起始位检测进程
begin
if rst=’1’ then
start<=’0’;
elsif rising_edge(clk16x) then if serialin=’0’ then
start<=’1’ ;
elsif over=’0’ then
start<=’1’;
else start<=’0’;
end if;
end if;
end process;
process(clk1x,serialin,i,rst) --读数据进程
begin
if rst=’1’ then
buff<= (others => ’1’);
Dout_P<= (others => ’1’);
i<=0;
over<=’1’;
elsif rising_edge(clk1x) then
if i<>
buff21<=serialin;
i<=i+1;
over<=’0’; else
i<=0;
over<=’1’;
Dout_P<=buff;
end if;
end if;
end process ;