• 方案介绍
  • 附件下载
  • 相关推荐
申请入驻 产业图谱

秒表设计Verilog代码Quartus仿真

08/22 11:24
346
加入交流群
扫码加入
获取工程师必备礼包
参与热点资讯讨论

2-240Z91K055Y0.doc

共1个文件

名称:秒表设计Verilog代码Quartus仿真

软件:Quartus

语言:Verilog

代码功能:

秒表设计

1、具有启动,暂停,复位功能

2、显示分、秒、毫秒

3、毫秒精确到10毫秒

FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com

演示视频:

设计文档:

1. 工程文件

2. 程序文件

3. 程序编译

4. RTL图

5. 仿真图

整体仿真

按键上升沿模块仿真

控制模块仿真

显示模块仿真

部分代码展示:

//跑表模块
module stopwatch1226(
input clk_50M,
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;
//计时状态机
always@(posedge clk_50M)
if(reset_key)
state<=reset_time_state;//复位状态
else
case(state)
reset_time_state://复位状态
state<=idle_state;
idle_state://空闲状态
if(start_key)
state<=cnt_time_state;
else
state<=idle_state;
cnt_time_state://计时状态
if(start_key)
state<=hold_time_state;
else
state<=cnt_time_state;
hold_time_state://暂停状态
if(start_key)
state<=cnt_time_state;
else
state<=hold_time_state;
default:;
endcase

点击链接获取代码文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=1056

  • 2-240Z91K055Y0.doc
    下载

相关推荐

Baidu
map