简单秒表设计仿真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、秒计时

相关推荐
ZPC82104 天前
docker 镜像备份
人工智能·算法·fpga开发·机器人
ZPC82104 天前
docker 使用GUI ROS2
人工智能·算法·fpga开发·机器人
tiantianuser4 天前
RDMA设计53:构建RoCE v2 高速数据传输系统板级测试平台2
fpga开发·rdma·高速传输·cmac·roce v2
博览鸿蒙4 天前
FPGA 和 IC,哪个前景更好?怎么选?
fpga开发
FPGA_小田老师4 天前
xilinx原语:ISERDESE2原语详解(串并转换器)
fpga开发·iserdese2·原语·串并转换
tiantianuser5 天前
RDMA设计50: 如何验证网络嗅探功能?
网络·fpga开发·rdma·高速传输·cmac·roce v2
Lzy金壳bing5 天前
基于Vivado平台对Xilinx-7K325t FPGA芯片进行程序在线更新升级
fpga开发·vivado·xilinx
unicrom_深圳市由你创科技5 天前
医疗设备专用图像处理板卡定制
图像处理·人工智能·fpga开发
tiantianuser5 天前
RDMA设计52:构建RoCE v2 高速数据传输系统板级测试平台
fpga开发·rdma·高速传输·cmac·roce v2
luoganttcc5 天前
Taalas 将人工智能模型蚀刻到晶体管上,以提升推理能力
人工智能·fpga开发