【文章內(nèi)容簡(jiǎn)介】
beginprocess(clk) variable cout1:integer range 0 to 929900000。 beginif clk39。event and clk=39。139。 then if cout1=9990000 240hz分頻為1hzthen cout1:=0。q1=39。139。 else cout1:=cout1+1。q1=39。039。end if。end if。end process。end Behavioral。計(jì)量模塊library IEEE。use 。use 。use 。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。entity jl isport(s,fin,clk1: in std_logic。 計(jì)量開(kāi)始信號(hào) en0:inout std_logic。 計(jì)量控制信號(hào) k1,k0: inout std_logic_vector(3 downto 0))。 路程的計(jì)量 end jl。architecture Behavioral of jl isbeginprocess(clk1)begin if clk139。event and clk1=39。139。 then 驅(qū)動(dòng)信號(hào)發(fā)揮作用 if s=39。039。 then en0=39。039。k1=0000。k0=0000。 初始化值 elsif (fin=39。139。) then if (k0=1001) then k0=0000。 if (k1=1001) then k1=0000。 else k1=k1+39。139。 end if。 else k0=k0+39。139。 end if。 if (k1amp。k000000010) then en0=39。139。 當(dāng)路程大于3km時(shí) ,使能信號(hào)en0開(kāi)始發(fā)揮作用 else en0=39。039。 end if。 else en0=39。039。 end if。 end if。end process。end Behavioral??刂颇Klibrary IEEE。use 。use 。use 。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。entity kz isport( clkin,e0,clk_in1:in std_logic。 輸入脈沖 clk3:out std_logic)。 輸出脈沖end kz。architecture Behavioral of kz isbeginprocess(clkin)beginif clkin39。event and clkin=39。139。 then if (e0=39。139。) then 根據(jù)條件選擇所需的通道 clk3=clk_in1。 end if。 end if。end process。end Behavioral。計(jì)費(fèi)模塊library IEEE。use 。use 。use 。 Unment the following library declaration