EDA數(shù)字電壓表設(shè)計_第1頁
EDA數(shù)字電壓表設(shè)計_第2頁
EDA數(shù)字電壓表設(shè)計_第3頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論