【正文】
139。end case。 when 00111101= d=11111100 。 when 00111001= d=11101001 。 when 00110101= d=11000101 。 when 00110001= d=10010110 。 when 00101101= d=01100011 。 when 00101001= d=00110101 。 when 00100101= d=00010011 。 when 00100001= d=00000001 。 when 00011101= d=00000100 。 when 00011001= d=00011010 。 when 00010101= d=01000000 。 when 00010001= d=01110000 。 when 00001101= d=10100010 。 when 00001001= d=11001111 。 when 00000101= d=11101111 。 when 00000001= d=11111110 。 when others = lcd(7 downto 1)=0000001。 when 6 = lcd(7 downto 1)=0100000。 when 2 = lcd(7 downto 1)=0010010。 end if。 count:=0。 shift=1110。lcd(0)=39。139。 elsif count=249999 then y=bcd10。 count:=count+1。 end if。 else null。 elsif counter999 then counter:=counter1000。 if counter99999 then counter:=counter100000。 bcd20=bcd21。 bcd31=0。 if count0=4999999 then count0:=0。 else null。 elsif count99999 then count:=count100000。 if count9999999 then count:=count10000000。 bcd20=bcd2。 bcd2=0。 if count1=4999999 then count1:=0。 cov_a:process(clk,amp,amp0)variable count : integer range 0 to 50004225。end if。 end if。139。 then if amp11111111 then amp=amp+1。 else amp0=00000000。 end if。 if u0=39。 end if。139。 then if z63 then z=z+1。 end if。 dd=00000000。 dd=amp0。 end if。 end if。 end if。 then if addradrr then dd4:=conv_integer(ram(addr))。 else dd=00000000。00)。 end if。 if sss(2)=39。 if sss(4)=39。 else con=con+1。 else if sss(1)=39。 addr=addr+1。00。00。 dd=00000000。 con=con+1。 dd=ddd(9 downto 2)。 addr=0。139。00)。139。 then dd2:=conv_integer(f(5 downto 0)amp。 then dd1:=conv_integer(d)。 end if。 then if con=z then dd0:=conv_integer(amp0)。 addr=0。00。 elsif sss=10000 then dd=d。 else if count=b then count:=0。 else if tmp0 then if sw=39。z=31。 coun=0。 end if。 end loop。 then adrr=0。 if adradrr then adrr=adr。 adr:=conv_integer(data3)*10+conv_integer(data2)。variable adr : integer range 0 to 63。variable count1 : integer range 0 to 12500000。qqq= 5000000 when ss=1000 else 50000000 when ss=0100 else 500000000 when ss=0010 else 500000。signal y : integer range 0 to 9。signal amp, amp0, d : std_logic_vector(7 downto 0)。signal b : integer range 0 to 78125000。signal qq : integer range 0 to 78125000。architecture behav of mine4 issubtype word is std_logic_vector( 7 downto 0 )。 預(yù)留接口 lcd : out std_logic_vector(7 downto 0)。 ss : in std_logic_vector( 3 downto 0 )。entity mine4 isport(clk : in std_logic。編程日期: library ieee。系統(tǒng)基本功能全部實(shí)現(xiàn),支持幅度精確的毫伏級(jí)信號(hào)發(fā)生,且精度較高。 設(shè)定幅度測得幅度測量誤差值5MV%10MV%20MV%50MV%100MV%200MV196MV%500MV498MV%%%%C. 方波B的頻率測量方波B是固定占空比(1/2)的方波,因而其輸出頻率較高,下表中頻率測量點(diǎn)偏高。 四、 系統(tǒng)測試 系統(tǒng)測試儀器系統(tǒng)測試采用TeKtronix公司生產(chǎn)的TDS3032型數(shù)字式雙通道熒光示波器,該示波器帶寬300兆赫,支持方波占空比的測量。三、 軟件實(shí)現(xiàn)BCD碼~二進(jìn)制數(shù)轉(zhuǎn)換模塊 該模塊應(yīng)用計(jì)數(shù)的方法完成BCD碼到二進(jìn)制數(shù)的轉(zhuǎn)換,仿真圖如下: 圖31. BCD碼~二進(jìn)制數(shù)轉(zhuǎn)換仿真圖 圖31中,A、B、C分別為三位十進(jìn)制數(shù)的BCD碼輸入:A為百位BCD碼,B為十位BCD碼,C為個(gè)位BCD碼輸入。該模塊主要由兩片DAC0832組成,一片用于接收FPGA傳來的波形數(shù)據(jù),將其轉(zhuǎn)化為模擬量輸出;另一片接收來自FPGA的波形幅度數(shù)據(jù),用以產(chǎn)生相應(yīng)的幅度電壓,將其作為基準(zhǔn)電壓輸入到上一片DAC0832的基準(zhǔn)電壓(Vref)輸入端口,實(shí)現(xiàn)輸出波的幅度可調(diào)。前者產(chǎn)生方式類似于正弦波,通過選擇64個(gè)采樣點(diǎn)中不同的點(diǎn)作為0~1切換點(diǎn),就可達(dá)到調(diào)節(jié)占空比的目的。DAC0832的數(shù)模轉(zhuǎn)換周期為1μS,用單片機(jī)每向DAC0832傳送一個(gè)數(shù)據(jù)最少要用兩條指令: MOV DPTR,ADDR_0832M