【正文】
8 when 9=d=1101111。 4 when 5=d=1101101。 0 when 1=d=0000110。 end case。 when 101=n=10。 when 001=n=s1。 else w=w+1。 數(shù)碼管位選 weixuan:process(clk,w) is begin if clk39。 when 1001=num=9。 when 0101=num=5。 when 0001=num=1。 when others =null。 when 10 to 19 =h1=1。 end if。event and c3=39。 end if。 end if。139。 then if en=39。 end process。139。 c2=39。 then if m0=9 then m0=0。event and c1=39。 end if。 end if。139。 then if en=39。 end process。139。 c0=39。 then if s0=9 then s0=0。event and t=39。 end if。 begin if clk39。秒,分,時 signal h:integer range 0 to 23。 architecture behaver of dzb is signal t:std_logic。置數(shù)選擇 x:in std_logic_vector(3 downto 0)。 use ??偟膩碚f,本次設(shè)計受益匪淺,一方面鞏固了EDA所學(xué)知識,另一方面對自己的思維方式也有一些反思。 連線照片如下: 電子表實物照片如下:從左到右為時,分,秒。 sel=w。 when 111=n=h1。 when 100=n=m1。 when 001=n=s1。 else w=w+1。 時 高位h1 時低 位h0 — 分 高位m1 分低 位m0 — 秒高位s1 秒低位s0 關(guān)鍵程序: process(clk,w) is begin if clk39。 when others =null。 when 10 to 19 =h1=1。 end if。event and c3=39。 時位不同于秒和分,因為時的低位不是任何進(jìn)制的計數(shù)器,因此不能像上面那樣用兩個計數(shù)器組合,而只能將時的高低位作為一個整 體,為一個二十四進(jìn)制計數(shù)器,接受來自分位的進(jìn)位信號,計數(shù)滿 24 時清零。 end if。 elsif en=39。 進(jìn)位 else s1=s1+1。039。 基于 VHDL 語言的電子表設(shè)計 4 秒高位 ss1:process(c0) is begin if c039。 and p=001 then s0=num。039。 c0=39。139。 秒的低位為十進(jìn)制,當(dāng)?shù)?10 個計數(shù)單位到達(dá)時, 計數(shù)值清零,并 產(chǎn)生一個進(jìn)位信號,用以更高位的計數(shù),而其他時候進(jìn)位信號為低電平,既沒有進(jìn)位 輸出 。 then count:=count+1。所以脈沖頻率選用 624Hz。 end if。 then 計數(shù)語句 elsif en=39。event and t=39。 ⑤ 當(dāng) p2p1p0 為“ 100”時, 分高 位置數(shù)。 ① 當(dāng) p2p1p0 為“ 000”時,不選擇任何位,此時電子表只是停止計數(shù),不置數(shù)。此電子表需要有置數(shù)功能,加一個控制開關(guān),當(dāng) 開關(guān)為低電平時計數(shù),當(dāng)開關(guān)為高電平時置數(shù)。可采用數(shù)碼管或液晶顯示,最好設(shè)計出個性化顯示界面。 ,將依據(jù)設(shè)計報告的質(zhì)量和實驗結(jié)果的描述計分。 注意事項: ,采用標(biāo)準(zhǔn)的作業(yè)考核類 封面, A4 打印??刹捎脭?shù)碼管或液晶顯示,最好設(shè)計出個性化顯示界面。 48 分,頻率分段設(shè)置 +3 分,頻率微調(diào) +5 分,頻率范圍酌情加分。 裝 訂