当前位置:网站首页>Verilog daily question (vl26 simple stopwatch)
Verilog daily question (vl26 simple stopwatch)
2022-07-28 17:22:00 【Don't make any more errors】
Title Description
Please write a module , Realize the function of simple stopwatch : With two outputs , When the output port second from 1-60 Cycle count , whenever second Count to 60, Output port minute Add one , Until minute=60, Pause counting .
The interface signal diagram of the module is as follows :


Problem solving :
The idea of this question is relatively simple ,second Count from 1 To 60 loop , full 60minute Into the 1, When minute Carry to 60 when , Another rising edge ,second Zeroing ,minute Do not change until the zero signal arrives .
`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 // Set low level to zero
second = 0;
minute = 0;
end
else if(minute == 6'd60) begin // Judgment is minute No when full 60, full 60 be minute unchanged ,second Zeroing
second = 0; minute = 60;
end
else if(second == 6'd60) begin //second full 60 To the next counting cycle ,minute+1
second = 1;
minute = minute+1;
end
else second = second + 1;
end
endmodule
边栏推荐
- The practice of the beego framework for goweb development: Section V project construction and user registration
- CNSA与CASC和CASIC的区别
- 总数据量超万亿行,玉溪卷烟厂通过正确选择时序数据库轻松应对
- Goweb开发之Beego框架实战:第三节 程序执行流程分析
- Analysis of browser decoding process
- Atcoder regular contest 133 d.range XOR (digital dp+ classification discussion)
- 异步FIFO基本原理(基于Verilog的简单实现)
- Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021
- 侦察机与预警机的区别
- Unity shader cartoon style rendering
猜你喜欢
随机推荐
mysql 最大建议行数2000w,靠谱吗?
Verilog 每日一题 (VL28 加减计数器)
Modeling Semantics with Gated Graph Neural Networks for KBQA
Verilog 每日一题 (VL30 RAM的简单实现)
配置V530交换机步骤
wpf命令按钮透明样式
Use Alibaba cloud's free SSL certificate
Realize the reset function of steering wheel UI with touch rotation and finger departure in unity
Microservice Architecture - service registry and service gateway (6.8) (Reprint)
高速电路设计实践——概述
Goweb开发之Beego框架实战:第四节 数据库配置及连接
List of supplementary questions
微服务架构-服务注册中心和服务网关(6.8) (转载)
Leetcode 2022.04.10 China Merchants Bank special competition D. store promotion (DP)
火了 2 年的服务网格究竟给微服务带来了什么?(转载)
Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)
Source code of voice live broadcast app
Using MVC in the UI of unity
Steps to configure V530 switch
Unity3d simple implementation of water surface shader








