【正文】
t=000000。 then states=0011。139。示波器也是一個(gè)很重要的工具,我們應(yīng)該熟練掌握。 其具體工作是: 由圖可看出: 當(dāng)主持人按下?lián)尨痖_(kāi)始按鈕, en=1,如果 20s 內(nèi)無(wú)人搶答,則輸出超時(shí)報(bào)警信號(hào)。他們的輸出結(jié)果要用 BCD 碼表示出來(lái),這樣是為了便于顯示譯碼連接,便于主持人直接讀出結(jié)果。這個(gè)搶答器有 4 個(gè)輸出結(jié)果顯示,選手代號(hào),計(jì)數(shù)器的個(gè)位和十位等。 6、編寫(xiě)頂層文件 頂層文件就是把前面幾個(gè)模塊綜合起來(lái),實(shí)現(xiàn)整個(gè)電路的功能。例如,時(shí)鐘頻率過(guò)高或過(guò)低都會(huì)影響實(shí)驗(yàn)效果。 then tmp=39。139。139。 end if。139。 end process p1。 end process p2。 states:in std_logic_vector(3 downto 0)。 then if a_out=1111 then a_out=0000。 then if b_out=0000 then b_out=0000。139。 end if。 end ponent。 u3:jf port map(clk,rst,en,add,states,a_out,b_out,c_out,d_out)。 architecture bhv of qiangda is ponent qdjb is port(clk2,en,rst:in std_logic。c_out=c_out。 else c_out=c_out1。 else b_out=b_out+1。event and clk=39。 library ieee。 else tb=tb1。 else ta=ta1。 architecture one of js is signal co:std_logic。t=t+1。 end if 。 then states=0010。 signal t:std_logic_vector(5 downto 0)。首先,我對(duì) VHDL 語(yǔ)言掌握的更加熟練,在編程時(shí)比以前速度更快,準(zhǔn)確度更高。 3、數(shù)據(jù)選 擇模塊 該模塊主要實(shí)現(xiàn)搶答的數(shù)據(jù)輸入方面的功能,因此,該模塊應(yīng)該包括 3 個(gè)輸入信號(hào) A[3..0]、 B[3..0 ]、 C[3..0]。搶答器具有數(shù)據(jù)鎖存和顯示功能。 1 .、 在搶答模塊中,應(yīng)該包含 四個(gè)搶答信號(hào) A,B,C,D,搶答時(shí)能信號(hào) S, 搶答狀態(tài)信號(hào)STATE, 搶答與報(bào)警時(shí)鐘 CLK2,系統(tǒng)復(fù)位信號(hào)RST,系統(tǒng)報(bào)警信號(hào) RING 上圖為本模塊的仿真波形。然后打開(kāi) GW48PK2 實(shí)驗(yàn)系統(tǒng),執(zhí)行菜單“ toolsprogrammer”,點(diǎn)擊“ add file? ”加載下載文件:點(diǎn)擊“ hardware setup? ”選擇編程下載方式“ ByteBlasterMV”; “ Programmer”窗口中“ mode”項(xiàng)選擇“ JTAG”,然后點(diǎn)擊“ start”開(kāi)始下載,下載完成后,即可在實(shí)驗(yàn)箱上驗(yàn)證設(shè)計(jì)電路。 use 。 then if a=39。139。event and clk2=39。 library ieee。 then co=39。 then tb=0010。 elsif ta=0000 and tb=0000 then warn=39。) then a_out=0101。 then if a_out=0000 then a_out=0000。139。039。 use 。 ponent jf is port(clk,rst,en,add:in std_logic。