【正文】
: PIO31PIO16)顯示測頻輸出;待測頻率輸入 FIN 由 clock0 輸入,頻率 可選 4Hz、 256HZ . . .或更高; 1HZ測頻控制信號 F1HZ可由 clock2 輸入(用電路帽選選 1Hz)。 三、 各模塊及頂層文件的設(shè)計 ( 1)、十進(jìn)制計數(shù) library ieee。 use 。 use 。 entity t10 is port (rst,clk,ena:in std_logic。 cout: out std_logic。 outy :out std_logic_vector(3 downto 0))。 end t10。 architecture behv of t10 is begin process (rst,ena,clk) variable cqi :std_logic_vector(3 downto 0)。 begin if rst=39。139。 then cqi :=(others =39。039。)。 elsif clk39。event and clk=39。139。 then if ena =39。139。 then if cqi 9 then cqi:=cqi+1。cout=39。039。 elsif cqi=9 then cqi :=(others =39。039。)。 cout=39。139。 end if。 elsif ena=39。039。 then cqi:=(others =39。039。)。 end if。 end if。 outy =cqi。 end process。 end behv。 ( 2)、 4 位 10 進(jìn)計數(shù)器 library ieee。 use 。 entity t10_4 is port(clk,rst,ena:in std_logic。 d:out std_logic_vector(15 downto 0))。 end entity。 architecture one of t10_4 is ponent t10 port (rst,clk,ena:in std_logic。 cout: out std_logic。 outy :out std_logic_vector(3 downto 0))。 end ponent。 signal e:std_logic_vector(3 downto 0)。 begin u1:t10 port map(clk=clk,r