名稱:基于FPGA的數(shù)字電壓表Verilog代碼Quartus仿真
軟件:Quartus
語言:Verilog
代碼功能:
設(shè)計(jì)要求
1.系統(tǒng)主要外設(shè):電位器(調(diào)節(jié)模擬信號(hào)輸入)、AD芯片TLC549;
2.系統(tǒng)主要功能:通過調(diào)節(jié)電位器,使用數(shù)碼管動(dòng)態(tài)顯示當(dāng)前電壓值,精度為小數(shù)點(diǎn)后兩位。
二、設(shè)計(jì)語言要求VHDL或 Verilog
FPGA代碼Verilog/VHDL代碼資源下載:www.hdlcode.com
演示視頻:
設(shè)計(jì)文檔:
1. 工程文件
2. 程序文件
3. 程序編譯
4. RTL圖
5. Testbench
6. 仿真圖
整體仿真圖
AD驅(qū)動(dòng)模塊仿真圖
數(shù)碼管顯示模塊仿真圖
部分代碼展示:
module?tlc549adc( inputclock,??????????//系統(tǒng)時(shí)鐘 input?????reset,?????????//復(fù)位,高電平有效 input?sdat_in,//TLC549串行數(shù)據(jù)輸入 output?adc_clk,//TLC549?I/O時(shí)鐘 output?cs_n,//TLC549?片選控制 output????[7:0]?HEX0,//數(shù)碼管-低亮 output????[7:0]?HEX1,//數(shù)碼管-低亮 output????[7:0]?HEX2,//數(shù)碼管-低亮 output????[7:0]?HEX3//數(shù)碼管-低亮 ); wire[7:0]data_out;//AD轉(zhuǎn)換數(shù)據(jù)輸出 wire?data_ready;//指示有新的數(shù)據(jù)輸出 //ADC驅(qū)動(dòng)模塊 adc?i_adc( .clock(clock), .reset(reset), .enable(1'b1), .sdat_in(sdat_in), .adc_clk(adc_clk), .cs_n(cs_n), .data_ready(data_ready), .data_out(data_out) );? //數(shù)碼管顯示模塊 segment?i_segment( .?clk(clock), .?data_out(data_out),//AD轉(zhuǎn)換數(shù)據(jù)輸出 .?HEX0(HEX0),//數(shù)碼管-低亮 .?HEX1(HEX1),//數(shù)碼管-低亮 .?HEX2(HEX2),//數(shù)碼管-低亮 .?HEX3(HEX3)//數(shù)碼管-低亮
點(diǎn)擊鏈接獲取代碼文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=567