【正文】
when 1110=q=0000000000000000。 when 0100=q=0000001100001100。 when 1100=q=0011111111111100。 end process。 architecture t_arc of ta is begin process(clk) variable tmp:std_logic_vector(3 downto 0)。 q=tmp1。 end cw。 when 0000000010000000=q=0111。 when 1000000000000000=q=1111。 本次課程設(shè)計(jì)已經(jīng)是我大學(xué)以后第二次課程設(shè)計(jì)了,我對(duì)整個(gè)過(guò)程都比較了解,不再像第一次那樣茫然,不知所措。另外, VHDL 具有并發(fā)性,采用 自上而下的結(jié)構(gòu)式設(shè)計(jì)方法,適合大型設(shè)計(jì)工程的分工合作。 when 0010000000000000=q=1101。 when 0000000000100000=q=0101。 entity cw is port( a: in std_logic_vector(15 downto 0)。 end if。 q:out std_logic_vector (3 downto 0))。 when others=null。 when 1010=q=0000001100001100。 when 0010=q=0000000000000000。 when 1100=q=0011111111111100。 when 0100=q=0011000110001100。 when 1110=q=0000000000000000。 when 0110=q=0011000000001100。 顯示 C when others=null。 when 1001=q=0011000000001100。 when 0001=q=0000000000000000。 when 1011=q=0011000110001100。 when 0011=q=0001111111111000。 when 1101=q=0000000000000000。 when 0101=q=0000011111000000。 when 1111=q=0000000000000000。 when 0111=q=0011000110001100。 顯示 8 end case。 when 1001=q=0011000110001100。 when 0001=q=0000000000000000。 when 1011=q=0000000000000000。 when 0011=q=0000000000000000。 when 1101=q=0000000000000000。 when 0101=q=0011111110001100。 when 1111=q=0000000000000000。 when 0111=q=0011000110001100。 顯示 4 end case。 when 1001=q=0000000110000000。 when 0001=q=0000000000000000。 when 1011=q=0000000000000000。 when 0011=q=0000000000000000。 when 1101=q=0000000000000000。 when 0101=q=0011000111111100。 when 1111=q=0000000000000000。 when 0111=q=0011111111111100。 顯示 0 end case。 when 1001=q=0011000000001100。 when 0001=q=0000000000000000。 補(bǔ)充: 以上程序是使用 4個(gè)撥碼開(kāi)關(guān)對(duì) LED 點(diǎn)陣進(jìn)行控制,若要用十六個(gè)撥碼開(kāi)關(guān),則只需加一個(gè)撥碼開(kāi)關(guān)譯碼電路, 其功能引腳如圖 6: 圖 6 撥碼開(kāi)關(guān)譯碼模塊引腳功能圖 、仿真結(jié)果 VHDL 語(yǔ)言源程序 列字符掃描信號(hào)產(chǎn)生源程序 library ieee。 點(diǎn)陣式 LED 顯示器采用逐行掃描式工作。 課程 設(shè)計(jì)內(nèi)容和 要求 、設(shè)計(jì)內(nèi)容 利用撥碼開(kāi)關(guān)控制點(diǎn)陣進(jìn)行十六進(jìn)制數(shù)字顯示,主要包括撥碼開(kāi)關(guān)譯碼電路,行選控制模塊和列字符掃描信號(hào)。 本題目采用自頂向下的設(shè)計(jì)方法,將系統(tǒng)分為兩個(gè)模塊,先分別用 MAX+PLUS II 文本設(shè)計(jì)輸入編寫(xiě) 列 選通模塊和列字 符掃描模塊, 然后 用圖形設(shè)計(jì)輸入將兩個(gè)模塊和相應(yīng)的輸入輸出進(jìn)行總的電路設(shè)計(jì), 通過(guò) 編譯、仿真、時(shí)序分析、器件編程、在線(xiàn)驗(yàn)證 等一系列操作,最后完成整個(gè)設(shè)計(jì)過(guò)程 。 、 各 模塊簡(jiǎn)介 功能描述 : ( 1) 列 選控制模塊 在實(shí)驗(yàn)儀器中, 16 16 點(diǎn)陣顯示的驅(qū)動(dòng)電路已經(jīng)做好,并且其 列 選通信號(hào)為一 416 譯碼器的輸出,所以我們?cè)谠O(shè)計(jì)點(diǎn)陣控制接口時(shí),其 列 選通信號(hào)輸出必須經(jīng) 416 編碼。 entity cora is port(ch: in std_logic_vector(3 downto 0)。 when 0100=q=0011111111111100。 when 1100=q=0000000000000000。 when 0010=q=0000000000000000。 7 when 1010=q=0000000000000000。 when 0010= case sel is when 0000=q=0000000000000000。 when 1000=q=0011000110001100。 when others=null。 when 0110=q=0011000110001100。 when 1110=q=0000000000000000。 when 0100=q=0111111111111110。 when 1100=q=0000000000000000。 when 0010=q=0000000000000000。 when 1010=q=0011000111111100。 when 0110= case sel is 10 when 0000=q=0000000000000000。 when 1000=q=0011000110001100。 when others=null。 when 0110=q=0011111111111100。 when 1110=q=0000000000000000。 when 0100=q=00111111111111