【文章內(nèi)容簡介】
待計時使能控制信號en行程3公里外的使能控制信號en0。以及進行滿量程清零。library ieee。 use 。 use 。 use 。 entity jiliang is port( s: in std_logic。 計量開始信號 fin: in std_logic。 計量路程的信號 stop: in std_logic。 等待信號 clk1: in std_logic。 計量驅(qū)動信號 en1,en0: buffer std_logic。 計量控制信號 k1,k0: buffer std_logic_vector(3 downto 0)。 路程的計量 m1,m0: buffer std_logic_vector(3 downto 0))。 時間的計量 end jiliang。 architecture rt2 of jiliang is signal w:integer range 0 to 59。 begin process(clk1) begin if (clk139。event and clk1=39。139。) then 驅(qū)動信號發(fā)揮作用 if s=39。039。 then w=0。en1=39。039。en0=39。039。m1=0000。m0=0000。 k1=0000。k0=0000。 初始化值 elsif stop=39。139。 then 等待信號為高時間控制信號開始計時 if w=59 then w=0。 if m0=1001 then m0=0000。 if m1=0101 then m1=0000。 else m1=m1+1。 end if。 else m0=m0+1。 end if。 計時 if m1amp。m000000010then en1=39。139。 當時間大于3min時使能信號 en1開始使能 else en1=39。039。 end if。 else w=w+1。en1=39。039。 end if。 elsif fin=39。139。 then