【文章內(nèi)容簡介】
d : out std_logic 鎖存、顯示輸出允許 )。 end teltcl。architecture behave of teltcl is signal clk1hz :std_logic。1HZ時鐘信號 signal count : std_logic_vector(2 downto 0)。6秒計數(shù) signal clr1 :std_logic。清零信號 signal ena1 :std_logic。允許計數(shù)信號 signal load1 :std_logic。允許計數(shù)信號 signal cq1,cq2,cq3,cq4 : INTEGER RANGE 0 TO 15。計數(shù)數(shù)據(jù) begin process(clk) 1HZ信號產(chǎn)生 variable ttemp : INTEGER RANGE 0 TO 999999。 begin IF clk=39。139。 AND clk39。event THEN IF ttemp=999999 THEN ttemp:=0。 ELSE IF ttemp500000 THEN clk1hz=39。139。 ELSE clk1hz=39。039。 END IF。 ttemp:=ttemp+1。 END IF。 end if。 end process。 process(Clk1hz)6秒計數(shù) begin if(Clk1hz39。event and Clk1hz=39。139。) then count=count+1。 if count6 then ena1=39。139。load1=39。039。clr1=39。039。 elsif count=6 then load1=39。139。ena1=39。039。clr1=39。039。 elsif count=7 then ena1=39。039。load1=39。039。clr1=39。139。 end if。 end if。 ena=ena1。 load=load1。clr=clr1。 end process。end behave。直流電機(jī)測速有時鐘使能的十進(jìn)制計數(shù)器產(chǎn)生LIBRARY IEEE。USE 。 ENTITY CNT10 IS PORT (CLK:IN STD_LOGIC。 計數(shù)時鐘信號 CLR:IN STD_LOGIC。 清零信號 ENA:IN STD_LOGIC。 計數(shù)使能信號 CQ :OUT INTEGER RANGE 0 TO 15。 4位計數(shù)結(jié)果輸出 CARRY_OUT:OUT STD_LOGIC)。 計數(shù)進(jìn)位