多位8段數(shù)碼管的控制_第1頁(yè)
多位8段數(shù)碼管的控制_第2頁(yè)
多位8段數(shù)碼管的控制_第3頁(yè)
多位8段數(shù)碼管的控制_第4頁(yè)
多位8段數(shù)碼管的控制_第5頁(yè)
已閱讀5頁(yè),還剩6頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、數(shù)碼管的控制設(shè)計(jì)一個(gè)電子時(shí)鐘1數(shù)碼管外觀2各種各樣的數(shù)碼管3共陰、共陽(yáng)4原理圖5FPGA相關(guān)引腳set_location_assignment PIN_239 -to seg0 # Aset_location_assignment PIN_224 -to seg1 # Bset_location_assignment PIN_227 -to seg2 # Cset_location_assignment PIN_236 -to seg3 # Dset_location_assignment PIN_237 -to seg4 # Eset_location_assignment PIN_234

2、-to seg5 # Fset_location_assignment PIN_226 -to seg6 # Gset_location_assignment PIN_233 -to seg7 # Hset_location_assignment PIN_221 -to segcs0set_location_assignment PIN_222 -to segcs1set_location_assignment PIN_223 -to segcs2set_location_assignment PIN_225 -to segcs3set_location_assignment PIN_228

3、-to segcs4set_location_assignment PIN_235 -to segcs5set_location_assignment PIN_238 -to segcs6set_location_assignment PIN_240 -to segcs76譯碼process(second0)begin case second0 is when 0000 =sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto

4、0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)sec0Seg(7 downto 0)=11111111; end case;end process;7多位控制process(clk_fresh)-位選信號(hào)(掃描時(shí)間1MS)variable cnt : std_logic_vector(2 downto 0);begin if (clk_freshevent and clk_fresh=1) then cnt:=cnt+1; if cnt=001 then segcs=00010000;

5、seg=min1Seg; -min elsif cnt=010 then segcs=00001000;seg=min0Seg; -8計(jì)時(shí)器Process(clk_1hz)BeginIf clk_1hzevent and clk_1hz=1 then if sec0 9 then sec0 = sec0 + 1; else sec0 = 0; if sec15 then sec1 = sec1 + 1; else sec1 = 0; if min09 then min0 = min0 + 1; else min0 = 0; if min15 then min1 = min1 + 1; else

6、 min1 = 0; if hour09 then hour0 = hour0 + 1; else hour0 = 0; if hour12 then hour1 = hour1+1; else hour1 = 0; end if;9時(shí)鐘準(zhǔn)備process(clk)- -1KHZ;用于數(shù)碼管掃描信號(hào)variable cnt : integer range 0 to 50000;-定時(shí)1MSbegin if clkevent and clk=1 then cnt:=cnt+1; if cnt25000 then clk_fresh=1; elsif cnt50000 then clk_fresh=0; else cnt:=0;clk_fresh=0; end if; end if;end process;process(clk_fresh)-此進(jìn)程產(chǎn)生1S的脈沖信號(hào)( clk_fresh為1K的脈沖信號(hào))variable cnt : integer range 0 to 1000;begin if clk_freshevent and clk_fresh=1 then cnt:=cnt+1; if cnt500 th

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論