【正文】
d。 use 。 cout=q。 else q=q+1。 elsif(clk39。 architecture rtl of 6 is signal q : std_logic_vector(2 downto 0)。 use 。 3. 單元模塊設(shè)計(jì)部分 單元模塊設(shè)計(jì)部分分四個(gè)部分,介紹數(shù)字鐘 選擇顯示數(shù)碼管和對(duì)應(yīng)的數(shù)模塊 CN6,信號(hào)選擇模塊 SEL61,七段碼譯碼器模塊 DISP和復(fù)位,秒,分,時(shí)顯示,設(shè)置模塊。 K4 模塊進(jìn)行復(fù)位,設(shè)置小時(shí)和分,輸出整點(diǎn)報(bào)時(shí)信號(hào)和時(shí),分,秒信號(hào)。此數(shù)字鐘具有時(shí),分,秒計(jì)數(shù)顯示功能,以 24 小時(shí)為計(jì)數(shù)循環(huán);能實(shí)現(xiàn) 清零,調(diào)節(jié)小時(shí),分鐘 以及整點(diǎn)報(bào)時(shí)的功能。 關(guān)鍵詞:數(shù)字鐘,計(jì)數(shù)器,數(shù)碼管, FPGA,VHDL 1. 設(shè)計(jì)思路 基于 VHDL語言,用 Top_Down的思想進(jìn)行設(shè)計(jì)。作品中選方案二。 CN6模塊的設(shè)計(jì) 即無進(jìn)位的六進(jìn)制計(jì)數(shù)器,由此提供選擇信號(hào),可提供選擇信號(hào),選擇顯示的數(shù)碼管及對(duì)應(yīng)的數(shù),循環(huán)掃描顯示。 entity 6 is port(res,clk : in std_logic。 begin process(res,clk) begin if res=39。event and clk=39。 end if。 end rtl。 entity sel61 is port(sel : in std_logic_vector(2 downto 0)。 architecture rtl of sel61 is begin process(a,b,c,d,e,f,sel) variable cout : std_logic_vector(3 downto 0)。 when 011=cout:=d。 q =cout。 圖 14 library ieee。 end。 when 0011=q=1001111。 when 0111=q=0100111。 end case。 CNT10模塊設(shè)計(jì) 10進(jìn)制計(jì)數(shù)器。 use 。 更多論文 8 cout : out std_logic_vector(3 downto 0))。event and clk=39。) then q=0000。 else q=q+1。 end process p1。 end if。 CNT6模塊設(shè)計(jì) 更多論文 9 即進(jìn)制計(jì)數(shù)器, CLK為秒信號(hào); RES為復(fù)位信號(hào),與 CLK同步; EN為選通信號(hào); COUT[3..0]輸出秒的十位; CA是進(jìn)位信號(hào)。 use 。 end。139。 elsif(en=39。 end if。 p2 : process(q) begin if(q=5) then ca=en。 end process p2。 EN 接 CNT6的進(jìn)位 CA,產(chǎn)生正常的時(shí)鐘; EN2 由外部斷口控制,可用來調(diào)節(jié)時(shí)間,高電平有效,輸出將以秒的速度遞增循環(huán)。 use 。 jingwei cout : out std_logic_vector(3 downto 0))。event and clk=39。) then q=0000。139。 end if。 else