【正文】
lowing library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。3 鎖存器library IEEE。039。139。139。out10=con。 end if。 end if。 end if。)。 then if con=9 then con=(others=39。 then if carry_in = 39。 else if rising_edge(clk) and clk=39。039。139。architecture Behavioral of counter_10 issignal con:STD_LOGIC_VECTOR (3 downto 0):=0000。 out10 : out STD_LOGIC_VECTOR (3 downto 0))。 carry_in:in std_logic。entity counter_10 is Port ( clk : in STD_LOGIC。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。2 模6計數(shù)器library IEEE。039。139。139。out10=con。 end if。 end if。 end if。)。 then if con=9 then con=(others=39。 then if carry_in = 39。 else if rising_edge(clk) and clk=39。039。139。architecture Behavioral of counter_10 issignal con:STD_LOGIC_VECTOR (3 downto 0):=0000。 out10 : out STD_LOGIC_VECTOR (3 downto 0))。 carry_in:in std_logic。entity counter_10 is Port ( clk : in STD_LOGIC。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。2 模10和模6計數(shù)器VHDL源程序 模10計數(shù)器library IEEE。end process。 then count_100hz_curr=count_100hz_next。fre100hz:process(count_1k_curr(3)) isbegin if rising_edge(count_1k_curr(3)) and count_1k_curr(3)=39。 end if。)。利用的到的10KHz分頻得到100Hz的時鐘P3:process(count_100hz_curr) isbegin if count_100hz_curr=9 then count_100hz_next=(others=39。end process。 then count_1k_curr=count_1k_next。fre1k:process(count_10k_curr(11)) isbegin if rising_edge(count_10k_curr(11)) and count_10k_curr(11)=39。 end if。)。利用的到的10KHz分頻得到1KHz的時鐘P2:process(count_1k_curr) isbegin if count_1k_curr=9 then count_1k_next=(others=39。out_10k=count_10k_curr(11)。 end if。139。end process。 else count_10k_next = count_10k_curr + 1。039。)。 signal count_100hz_curr:std_logic_vector(3 downto 0):=(others=39。039。)。 signal count_1k_curr:std_logic_vector(3 downto 0):=(others=39。039。)。 signal count_10k_curr:std_logic_vector(11 downto 0):=(others=39。039。end div_fre_1khz_new。 out_1k : out STD_LOGIC。entity div_fre_1khz_new is Port ( clk : in STD_LOGIC。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。參考文獻[1] 基于FPGA的數(shù)字秒表的設(shè)計_楊遠成[2] 一種基于FPGA的數(shù)字秒表設(shè)計方法_王永維[3] 電子技術(shù)綜合實驗資料秒表[4] 電子技術(shù)綜合實驗資料ISE開發(fā)流程[5] 電子技術(shù)綜合實驗資料modelsim仿真流程附錄1 分頻器VHDL源程序library IEEE。通過實驗驗證,本文設(shè)計的數(shù)字秒表計時準確、 性能穩(wěn)定, 可以很容易嵌入其他復(fù)雜的數(shù)字系統(tǒng),充當計時模塊。本文所介紹數(shù)字秒表設(shè)計方法, 采用了當下最流行的EDA設(shè)計手段。設(shè)計輸入完成后,進行整體的編譯和邏輯仿真,然后進行轉(zhuǎn)換、延時仿真生成配置文件,最后下載至FPGA器件,完成結(jié)果功能配置,實現(xiàn)其硬件功能。圖31為秒表系統(tǒng)的 RTL Schematic