下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、數(shù)字電壓表源程序:module shuzidianya(ale,start,oe,addr,seg,d,eoc,clk,clk1k);output ale,start,oe; /通道鎖存,轉(zhuǎn)換開始,輸出允許output2:0 addr; /通道選擇output7:0 seg; /數(shù)碼管段選input7:0 d; /轉(zhuǎn)換結(jié)果輸入input eoc,clk,clk1k; /轉(zhuǎn)換結(jié)束wire7:0 q;wire3:0 dec_in;adcint(ale,start,oe,addr,q,d,clk,eoc);segscan segscan(dec_in,q,clk1k);decoder decoder
2、(seg,dec_in);endmodule/ADC0809控制模塊module adcint(ale,start,oe,addr,q,d,clk,eoc);output ale,start,oe;output2:0 addr;output7:0 q;input7:0 d;input clk,eoc;reg ale,start,oe;reg7:0 q;reg lock;reg4:0 present_state,next_state;parameter st0=5b00001, st1=5b00010, st2=5b00100, st3=5b01000, st4=5b10000;assign a
3、ddr=3b000;always (posedge clk)begin present_state=next_state;endalways (present_state or eoc)begin case(present_state)st0:next_state=st1;st1:next_state=st2;st2: begin if(eoc) next_state=st3; else next_state=st2; endst3:next_state=st4;st4:next_state=st0;default:next_state=st0;endcaseendalways (presen
4、t_state) begin case(present_state) st0:begin ale=0;start=0;lock=0;oe=0;end st1:begin ale=1;start=1;lock=0;oe=0;end st2:begin ale=0;start=0;lock=0;oe=0;end st3:begin ale=0;start=0;lock=0;oe=1;end st4:begin ale=0;start=0;lock=1;oe=1;end default begin ale=0;start=0;lock=0;oe=0;end endcase endalways (po
5、sedge lock)begin q=d; endendmodulemodule weisaomiao(clk,sel1);input clk;output 1:0sel1;reg 1:0sel1;always (posedge clk )beginsel1=sel1+1; endendmodulemodule suocun( qo, din, load );output7:0 qo;input7:0 din;input load;reg7:0 qo;always ( posedge load )beginqo = din;endendmodulemodule segscan(dout,din
6、,sel);output3:0 dout;input 7:0 din;input sel;reg3:0 dout;always (sel or din)begin if (sel) dout=din3:0; else dout=din7:4;endendmodule/顯示譯碼模塊module decoder(decoderout,dec_in);output7:0 decoderout;input3:0 dec_in;reg7:0 decoderout;always (dec_in)begin case(dec_in)4h0: decoderout=8b00111111;4h1: decode
7、rout=8b00000110;4h2: decoderout=8b01011011;4h3: decoderout=8b01001111;4h4: decoderout=8b01100110;4h5: decoderout=8b01101101;4h6: decoderout=8b01111101;4h7: decoderout=8b00000111;4h8: decoderout=8b01111111;4h9: decoderout=8b01101111;4ha: decoderout=8b01110111;4hb: decoderout=8b01111100;4hc: decoderout=8b0
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- DB54T 0415-2024藏式傳統(tǒng)陶器制作工藝
- 廣東省2025年高三第一次模擬(期末)語文試題含解析
- 甘肅省玉門市玉門一中2024-2025學(xué)年高三5月適應(yīng)性考試語文試題含解析
- 福建省長泰一中解析重點中學(xué)2025年高三下4月大練習(xí)語文試題含解析
- 福建省莆田市第二十五中學(xué)2025年高中畢業(yè)班第二次質(zhì)量預(yù)測語文試題含解析
- 福建閩侯第四中學(xué)2024-2025學(xué)年高三下學(xué)期開學(xué)質(zhì)檢語文試題含解析
- 關(guān)于夏日清涼飲料的調(diào)查問卷
- 四川省廣安市友實學(xué)校2024-2025學(xué)年高二上學(xué)期第一次月考地理試卷
- 北京市十一所學(xué)校2025屆高三兩校下學(xué)期聯(lián)考語文試題含解析
- 巴中中學(xué)2025屆高考模擬測試語文試題(二)含解析
- 教科版三年級科學(xué)上冊第一單元《水》復(fù)習(xí)課件
- 二面角-完整版課件
- 醫(yī)院檔案分類工作方案
- 浙江省生物安全實驗室培訓(xùn)考試試卷(樣卷)
- 部編版四年級道德與法治上冊全冊教案
- 2022年網(wǎng)絡(luò)與信息安全培訓(xùn)教育計劃
- 慢性腎小球腎炎英文教學(xué)課件
- 美容美發(fā)行業(yè)員工手冊范本
- 自考操作系統(tǒng)課后答案
- 卡通藍(lán)色班干部競選PPT模板
- 《社會學(xué)概論》授課教案
評論
0/150
提交評論