【正文】
。 end process。 _ when others=null。 8 when 9=d=1101111。 6 when 7=d=0000111。 4 when 5=d=1101101。 2 when 3=d=1001111。 0 when 1=d=0000110。 sel=w。 end case。 when 111=n=h1。 when 101=n=10。 when 011=n=m0。 when 001=n=s1。 end if。 else w=w+1。139。 數(shù)碼管位選 weixuan:process(clk,w) is begin if clk39。 end case。 when 1001=num=9。 when 0111=num=7。 when 0101=num=5。 when 0011=num=3。 when 0001=num=1。 end process。 when others =null。 when 20 to 23 =h1=2。 when 10 to 19 =h1=1。 case h is when 0 to 9 =h1=0。 end if。 then if h=23 then h=0。event and c3=39。 end process。 end if。139。 end if。 c3=39。139。 then if m1=5 then m1=0。 then if en=39。event and c2=39。 end process。 end if。139。 end if。 c2=39。139。 then if m0=9 then m0=0。 then if en=39。event and c1=39。 end process。 end if。139。 end if。 c1=39。139。 then if s1=5 then s1=0。 then if en=39。event and c0=39。 end process。 end if。139。 end if。 c0=39。139。 then if s0=9 then s0=0。 then if en=39。event and t=39。 end process。 end if。139。 begin if clk39。 進(jìn)位信號(hào) signal w:std_logic_vector(2 downto 0)。秒,分,時(shí) signal h:integer range 0 to 23。置數(shù)值 signal n:integer range 0 to 10。 architecture behaver of dzb is signal t:std_logic。 掃描 d:out std_logic_vector(6 downto 0))。置數(shù)選擇 x:in std_logic_vector(3 downto 0)。 en:in std_logic。 use 。 use ??偟膩碚f,本次設(shè)計(jì)受益匪淺,一方面鞏固了EDA所學(xué)知識(shí),另一方面對(duì)自己的思維方式也有一些反思。還有時(shí)的高低位如何在數(shù)碼管上顯示 出來 的問題 , 因?yàn)闀r(shí)是二十四進(jìn)制的,自己想了很久也沒有辦法解決,后來請(qǐng)教同學(xué),經(jīng)同學(xué)點(diǎn)撥,采用分段賦值的方法讓時(shí)的地高位分別顯示。 連線照片如下: 電子表實(shí)物照片如下:從左到右為時(shí),分,秒。輸入管腳有:脈沖 clk,使能控制端 en,置數(shù)選擇 p2p1p0,置數(shù)端 x3x2x1x0。 sel=w。 end case。 when 111=n=h1。 第 10 種狀態(tài),顯示時(shí)與分之間的短線。 w