--随便写写,不是最优的,另外复位信号时同步复位process(clk)if( clk'event and clk='1')then if(rst='1')then count<=(others=>'0'); elsif(clken='1')then if(count=99)then count<=(others=>'0'); else count<=count+1; end if; end if;end if;end process;