成人免费无码不卡毛片,亚洲AⅤ无码精品一区二区三区,国产尤物精品视频,久久精品日本亚洲,欧美成人一区三区无码乱码A片,中文字日产幕码一区二区色哟哟,亞洲日韓中文字幕網AV

  • 方案介紹
  • 附件下載
  • 相關推薦
申請入駐 產業(yè)圖譜

vivado數字秒表verilog代碼ego1開發(fā)板電子秒表跑表

05/29 11:01
187
加入交流群
掃碼加入
獲取工程師必備禮包
參與熱點資訊討論

1-231124215411U5.doc

共1個文件

名稱:vivado數字秒表verilog代碼ego1開發(fā)板電子秒表跑表(代碼在文末下載)

軟件:VIVADO

語言:Verilog

代碼功能:

數字秒表設計:

1、秒表的設計精確到10毫秒(0.01秒)。

2、可通過按鍵控制秒表啟動、暫停、復位。

3、數碼管顯示分、秒、毫秒。

FPGA代碼Verilog/VHDL代碼資源下載:www.hdlcode.com

本代碼已在ego1開發(fā)板驗證,開發(fā)板如下,其他開發(fā)板可以修改管腳適配:

ego1開發(fā)板.png

演示視頻:

設計文檔:

1. 工程文件

2. 程序文件

3. 程序編譯

4. 管腳分配

5. RTL圖

6. 仿真

Testbench

整體仿真圖

分頻模塊

按鍵消抖模塊

秒表控制模塊

顯示譯碼模塊

部分代碼展示:

//跑表模塊
module?stopwatch(
input?clk_in,
input?clk_100Hz,//100Hz--對應10ms
input?start_key,//啟動//暫停
input?reset_key,//復位
output?[7:0]?stopwatch_Millisecond,//10毫秒
output?[7:0]?stopwatch_second,//秒
output?[7:0]?stopwatch_minute//分
);
parameter?idle_state=3'd0;
parameter?cnt_time_state=3'd1;
parameter?hold_time_state=3'd2;
parameter?reset_time_state=3'd3;
reg?[2:0]?state=3'd0;
//計時狀態(tài)機
always@(posedge?clk_in)
if(reset_key)
state<=reset_time_state;//復位狀態(tài)
else
case(state)
reset_time_state://復位狀態(tài)
state<=idle_state;
idle_state://空閑狀態(tài)
if(start_key)
state<=cnt_time_state;
else
state<=idle_state;
cnt_time_state://計時狀態(tài)
if(start_key)
state<=hold_time_state;
else
state<=cnt_time_state;
hold_time_state://暫停狀態(tài)
if(start_key)
state<=cnt_time_state;
else
state<=hold_time_state;
default:;
endcase
reg?[7:0]?Millisecond_cnt=8'd0;//10毫秒
reg?[7:0]?second_cnt=8'd0;//秒
reg?[7:0]?minute_cnt=8'd0;//分
always@(posedge?clk_in)
if(state==reset_time_state)//復位狀態(tài)
minute_cnt<=8'd0;
else
if(state==cnt_time_state?&&?clk_100Hz==1)//計時狀態(tài)
if(Millisecond_cnt==8'd99?&&?second_cnt==8'd59)//59秒99'時向前記1分
if(minute_cnt<8'd59)
minute_cnt<=minute_cnt+8'd1;//計時到990ms,下一次就到1秒了
else
minute_cnt<=8'd0;
else
minute_cnt<=minute_cnt;
else;
always@(posedge?clk_in)
if(state==reset_time_state)//復位狀態(tài)
second_cnt<=8'd0;
else
if(state==cnt_time_state?&&?clk_100Hz==1)//計時狀態(tài)
if(Millisecond_cnt==8'd99)//990ms時向前記1秒
if(second_cnt<8'd59)
second_cnt<=second_cnt+8'd1;//計時到990ms,下一次就到1秒了
else
second_cnt<=8'd0;
else
second_cnt<=second_cnt;
else;
always@(posedge?clk_in)
if(state==reset_time_state)//復位狀態(tài)
Millisecond_cnt<=8'd0;
else
if(state==cnt_time_state?&&?clk_100Hz==1)//計時狀態(tài)
if(Millisecond_cnt<8'd99)//計時到990ms,下一次就到1秒了
Millisecond_cnt<=Millisecond_cnt+8'd1;
else
Millisecond_cnt<=8'd0;//計時到990ms,下一次就到1秒了
else;
assign?stopwatch_Millisecond=Millisecond_cnt;
assign?stopwatch_second=second_cnt;
assign?stopwatch_minute=minute_cnt;
endmodule

點擊鏈接獲取代碼文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=309

  • 1-231124215411U5.doc
    下載

相關推薦

吴桥县| 银川市| 安国市| 新津县| 土默特右旗| 潢川县| 清苑县| 漳平市| 新建县| 石楼县| 台北县| 凤凰县| 大英县| 金华市| 永年县| 东乡县| 蚌埠市| 东丽区| 雅江县| 象州县| 贵南县| 烟台市| 雅安市| 延川县| 色达县| 桂东县| 苏尼特右旗| 广德县| 安乡县| 灵璧县| 乌拉特后旗| 呼玛县| 宝兴县| 阳泉市| 乳源| 玉门市| 白玉县| 敦化市| 嵊州市| 尉氏县| 磐安县|