简单秒表设计仿真verilog跑表,源码/视频

名称:简单秒表设计仿真

软件:Quartus

语言:Verilog

代码功能:

秒表显示最低计时为10ms,最大为59:99,超出返回00:00

具有复位、启动、暂停三个按键

四个数码管分别显示4个时间数字。

演示视频:简单秒表设计仿真verilog跑表_Verilog/VHDL资源下载

FPGA代码资源下载网:hdlcode.com

代码下载:

简单秒表设计仿真verilog跑表_Verilog/VHDL资源下载名称:简单秒表设计仿真(代码在文末付费下载)软件:Quartus语言:Verilog代码功能:秒表显示最低计时为10ms,最大为59:99,超出返回00:00具有复位、启动、暂停三个按键四个数码管分别显示4个时间数字。演示视频:FPGA代码资源下载网:hdlcode.com部分代码展示module stopwatch(input clk,//100Hz--对应10msinput start_keyhttp://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=200

部分代码展示

复制代码
module stopwatch(
input clk,//100Hz--对应10ms
input start_key,//启动
input stop_key,//暂停
input reset_key,//复位
output reg [7:0] display0,//输出数码管显示
output reg [7:0] display1,//输出数码管显示
output reg [7:0] display2,//输出数码管显示
output reg [7:0] display3//输出数码管显示
);
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)
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(stop_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
reg [7:0] Millisecond_cnt=8'd0;//10毫秒
reg [7:0] second_cnt=8'd0;//秒
always@(posedge clk)
if(state==reset_time_state)//复位状态
second_cnt<=8'd0;
else
if(state==cnt_time_state)//计时状态
if(Millisecond_cnt==8'd99)//990ms时向前记1秒
if(second_cnt<8'd59)
second_cnt<=second_cnt+8'd1;//计时到990ms,下一次就到1秒了

设计文档:

1.工程文件

2.程序代码

3.程序运行

4.Testbench

5.仿真图

秒表显示最低计时为10ms,最大为59:99,超出返回00:00

具有复位、启动、暂停三个按键

四个数码管分别显示4个时间数字。

1、整体仿真图

2、复位功能

3、启动按键

4、暂停按键

5、10ms毫秒计时

6、秒计时

相关推荐
璞致电子19 小时前
基于 AD9361 (PZSDR‑P201Pro) 软件无线电实战综述:从板卡选型、硬件平台升级到 GNU Radio QPSK 完整收发链路
经验分享·嵌入式硬件·fpga开发·软件无线电·sdr·璞致电子
炎龙铠甲会合体21 小时前
从 SPEC 到上板:在 Zynq-7020 上用 RTL 手写一个 YOLO 卷积加速器(完整教程)
yolo·fpga开发·axi·芯片验证
FPGA小徐21 小时前
Vivado 按键消抖与复位模块代码修复详解:KEY_TOP、key、rst_gen 完整实战
fpga开发
炎龙铠甲会合体1 天前
AXI2ICACHE— AXI4-Full 四路组相联指令 Cache 设计与 UVM 验证
fpga开发·面试·芯片验证
bingcheby1 天前
FMQL15/20/45 (复旦微青龙系列 PSOC)新手使用说明
fpga开发
漫漫长远1 天前
低功耗UPF介绍(一)
笔记·嵌入式硬件·学习·fpga开发
自小吃多1 天前
【Verilog/FPGA】存储器(数组)
嵌入式硬件·fpga开发
szxinmai主板定制专家1 天前
RK3588+FPGA异构架构|高速数据采集+边缘AI落地应用全解析
人工智能·嵌入式硬件·fpga开发·架构·zynq
玖石书2 天前
LVGL的windows开发环境安装指南
windows·数字人·lvgl·仿真
明德扬2 天前
FPGA MIPI 多路视频聚合方案
fpga开发·mipi视频拼接·mipi多路拼接·mipi协议·mipi视频拼接方案·fpga mipi方案·mipi csi