当前位置:网站首页>如何实现时钟信号分频?
如何实现时钟信号分频?
2022-07-01 14:56:00 【知行&】
在进行数字电路实验时,经常需要对时钟信号进行分频,以实现输出不同频率的时钟信号。
以下题为例:要求将50MHz的时钟信号进行分频,产生1MHz的时钟信号。其Verilog描述如下:
首先,精确理解一下50MHz的时钟频率究竟是什么概念?

50MHz的时钟信号,其周期为1/50M秒,1秒有50M个方波信号。
module example(clk_out,clk_in);
output reg clk_out;
input clk_in;
reg [30:0]cnt;
[email protected](posedge clk_in)
begin
if(cnt==24999999)
begin
clk_out<=!clk_out;
cnt<=0;
end
else
cnt<=cnt+1;
end
endmodule
端口列表非常简单,只有一个输入的时钟信号和一个输出的时钟信号。
50MHZ÷1HZ=50000000,那么可将50MHZ的时钟信号进行计数,设置初始值cnt=0。当计数cnt没有达到50000000/2即25000000次时,cnt自增1;
当计数cnt达到50000000/2即25000000次时。clo_out <= ~clkout,即翻转,并且cnt从0开始重新计数。
如此反复即可实现clk_out的输出信号为1HZ。
本文内容结束,如有不足,欢迎交流!
边栏推荐
- 22-06-26周总结
- 榨汁机UL982测试项目有哪些
- Solid smart contract development - easy to get started
- It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!
- Basic use process of cmake
- 首届技术播客月开播在即
- Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables
- Redis安装及Ubuntu 14.04下搭建ssdb主从环境
- 职场太老实,总被欺负怎么办?
- Storage form of in-depth analysis data in memory
猜你喜欢

Vnctf2022 open web gocalc0

Junda technology - wechat cloud monitoring scheme for multiple precision air conditioners

竣达技术丨室内空气环境监测终端 pm2.5、温湿度TVOC等多参数监测

关于重载运算符的再整理

openssl客户端编程:一个不起眼的函数导致的SSL会话失败问题

leetcode:329. Longest increasing path in matrix

建立自己的网站(14)

IDEA全局搜索快捷键(ctrl+shift+F)失效修复

微信公众号订阅消息 wx-open-subscribe 的实现及闭坑指南

What are the books that have greatly improved the thinking and ability of programming?
随机推荐
cmake 基本使用过程
About the use of HTTP cache validation last modified and Etag
22-06-26周总结
Error-tf.function-decorated function tried to create variables on non-first call
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
[leetcode] 16. The sum of the nearest three numbers
Basic operations of SQL database
The first technology podcast month will be broadcast soon
Internet hospital system source code hospital applet source code smart hospital source code online consultation system source code
Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables
Cannot link redis when redis is enabled
关于软件测试的一些思考
DirectX repair tool v4.1 public beta! [easy to understand]
Ensure production safety! Guangzhou requires hazardous chemical enterprises to "not produce in an unsafe way, and keep constant communication"
Word2vec yyds dry goods inventory
In hot summer, please put away this safe gas use guide!
问题随记 —— Oracle 11g 卸载
Take you to API development by hand
【锁】Redis锁 处理并发 原子性
数据产品经理需要掌握哪些数据能力?