当前位置:网站首页>Verilog 每日一题(VL26 简易秒表)
Verilog 每日一题(VL26 简易秒表)
2022-07-28 16:23:00 【别再出error了】
题目描述
请编写一个模块,实现简易秒表的功能:具有两个输出,当输出端口second从1-60循环计数,每当second计数到60,输出端口minute加一,一直到minute=60,暂停计数。
模块的接口信号图如下:


解题:
这一题的思路比较简单,second的计数从1到60循环,满60minute进1,当minute进位到60时,再来一个上升沿,second置零,minute不变直到置零信号到来。
`timescale 1ns/1ns
module count_module(
input clk,
input rst_n,
output reg [5:0]second,
output reg [5:0]minute
);
always @(posedge clk or negedge rst_n) begin
if(~rst_n) begin //低电平置零
second = 0;
minute = 0;
end
else if(minute == 6'd60) begin //判断是minute否时满60,满60则minute不变,second置零
second = 0; minute = 60;
end
else if(second == 6'd60) begin //second满60到下一计数周期,minute+1
second = 1;
minute = minute+1;
end
else second = second + 1;
end
endmodule
边栏推荐
- 微服务架构-服务注册中心和服务网关(6.8) (转载)
- Games101-assignment05 ray tracing - rays intersect triangles
- Verilog 每日一题 (VL5 信号发生器)
- valarray数值库学习
- Unity shader uses rendered texture to achieve glass effect
- Unity shader realizes mirror effect with rendered texture
- Analysis of browser decoding process
- Goweb开发之Iris框架实战:项目总结与回顾
- 火了 2 年的服务网格究竟给微服务带来了什么?(转载)
- Ugui learning notes (II) Scrollview related
猜你喜欢

: No such file or directory

Goweb开发之Beego框架实战:第一节 Beego框架介绍

Verilog 每日一题(VL6 数据串转并电路)

利用SQL Server代理作业对数据库进行定时还原

GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification

Unity shader cartoon style rendering

数据库故障容错之系统时钟故障

Janus series article 3 API usage guide videoroom creating a new video room

The actual combat of the beego framework of goweb development: Section III program execution process analysis

Using MVC in the UI of unity
随机推荐
Educational codeforces round 126 (rated for Div. 2) f.teleporters (two sets and two points)
2022 Niuke multi school second CDE
Goweb开发之Beego框架实战:第三节 程序执行流程分析
Message Passing for Complex Question Answering over Knowledge Graphs
Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)
Ugui learning notes (IV) ugui event system overview and Usage Summary
UNIQUE VISION Programming Contest 2022(AtCoder Beginner Contest 248)G. GCD cost on the tree
Unity shader procedural texture
高速电路中电阻的选择
SUSE CEPH add nodes, reduce nodes, delete OSD disks and other operations – storage6
Games101-assignment05 ray tracing - rays intersect triangles
Differences between CNSA and CASC and CASIC
Codeforces round 768 (Div. 2) e.paint the middle (greedy / interval relationship processing)
Janus series article 3 API usage guide videoroom creating a new video room
高速电路中电容的选型和应用——详解
Realize the reset function of steering wheel UI with touch rotation and finger departure in unity
Self study examination in April 2021
MySQL数据库增删改查(基础操作命令详解)
The 2021 ICPC ASIA Taipei Regional programming contest L. leadfoot (combinatorics /2-adic assignment function +kummer theorem)
Deep understanding of deepsea and salt deployment tools – storage6