【正文】
signal latchdata6: STD_LOGIC_VECTOR (3 downto 0):=0000。signal B:STD_LOGIC:=39。 value2 : in STD_LOGIC_VECTOR (3 downto 0)。 data_in3 : in STD_LOGIC_VECTOR (3 downto 0)。 latch : out STD_LOGIC。 end process。039。end process。process(hide,dataout)beginled=1111111。 else count=count+1。 point : out STD_LOGIC。end process。event and latch_in=39。 thendata_out1=data_in1。 data_in4 : in STD_LOGIC_VECTOR (3 downto 0)。039。 out6 : out STD_LOGIC_VECTOR (3 downto 0)。count_out=count。 count_out : out STD_LOGIC_VECTOR (3 downto 0))。 and B=39。039。 else fcount1=fcount1 +1。039。NET ledout5 LOC = A13。因為系統(tǒng)要求,顯示為6為數(shù)字,所以需要6位的計數(shù)器。有上述頻率測量原理與方法的討論可知,計時法適合于對低頻信號的測量,而計數(shù)法則適合于對較高頻信號的測量。如在1s內(nèi)記錄1000個脈沖,則被測信號的頻率為1000HZ。計數(shù)法測量原理 設(shè)在T期間,計數(shù)器的精確計數(shù)值應(yīng)為N,根據(jù)計數(shù)器的計數(shù)特性可知,N1的絕對誤差是N1=N+1,N1的相對誤差為δN1=(N1N)/N=1/N。 單元電路的劃分分頻電路FPGA的石英振蕩器,產(chǎn)生頻率為48MHz的方波信號。end ponent。NET sel2 LOC = E7。 clk1k=not clk1k。end Behavioral。end if。039。 thencount=0000。 and count=1001 else 39。 carry_in : in STD_LOGIC。beginu1:counter port map (Csignal,clear,count_en,overflow1,out1)。 over_out : out STD_LOGIC。139。process(latch_in)beginif latch_in39。end if。signal dataout:STD_LOGIC_VECTOR (3 downto 0):=0000。g=39。 when 0010=led=0010010。end if。 when 001 = hide = 39。 sel : out STD_LOGIC_VECTOR (2 downto 0):=000。 count_en : in STD_LOGIC。 over_in : in STD_LOGIC。 clk1k : in STD_LOGIC。signal counterout2: STD_LOGIC_VECTOR (3 downto 0):=0000。u5:display port map (latchdata1,latchdata2,latchdata3,latchdata4,latchdata5,latchdata6,ledout,clk1k,point,g,sel)。signal latchdata1: STD_LOGIC_VECTOR (3 downto 0):=0000。039。 data_out5 : out STD_LOGIC_VECTOR (3 downto 0)。 out6 : out STD_LOGIC_VECTOR (3 downto 0)。 clkout1 : out STD_LOGIC。 when 100 = hide = hide_4。039。 when 1000=led=0000000。when 100 = dataout=value4。039。 value3 : in STD_LOGIC_VECTOR (3 downto 0)。process(latch_in)beginif latch_in39。139。 data_out6 : out STD_LOGIC_VECTOR (3 downto 0))。over=overflow6。signal overflow2:STD_LOGIC :=39。 out1 : out STD_LOGIC_VECTOR (3 downto 0)。 then if count=1001 then count=0000。end Behavioral。end process。architecture Behavioral of gatecontrol issignal A:STD_LOGIC:=39。process(clk1k) begin if clk1k39。architecture Behavioral of fenpin issignal fcount1 :integer range 1 to 500:=1。NET ledout0 LOC = A11。clkout =not clkout。首先把被測信號通過二分頻,獲得一個高電平時間是一個信號周期T的方波信號;然后用一個一直周期T1的高頻方波信號作為計數(shù)脈沖,在一個信號周期T的時間內(nèi)對T1信號進(jìn)行計數(shù),如圖所示?,F(xiàn)代電子技術(shù)綜合實驗數(shù)字頻率計設(shè)計實驗報告姓名: 學(xué)號:一、系統(tǒng)總體設(shè)計設(shè)計要求被測輸入信號:方波測試頻率范圍為:10Hz~1MHz 擴(kuò)展 1MHz ~100MHz量程分為三檔:第一檔:閘門時間為1S時, 第二檔:, 第三檔:。計時法計時法又稱為測周期法,測周期法使用被測信號來控制閘門的開閉,而將標(biāo)準(zhǔn)時基脈沖通過閘門加到計數(shù)器,閘門在外信號的一個周期內(nèi)打開,這樣計數(shù)器得到的計數(shù)值就是標(biāo)準(zhǔn)時基脈沖外信號的周期值,然后求周期值的倒數(shù),就得到所測頻率值。 then if t = 5 thent = 1。NET g LOC = D7。end