当前位置:网站首页>如何实现时钟信号分频?
如何实现时钟信号分频?
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。
本文内容结束,如有不足,欢迎交流!
边栏推荐
- tensorflow2-savedmodel convert to tflite
- 购物商城6.27待完成
- Opencv Learning Notes 6 -- image mosaic
- opencv学习笔记五--文件扫描+OCR文字识别
- APK签名原理
- 炎炎夏日,这份安全用气指南请街坊们收好!
- Zabbix API与PHP的配置
- tensorflow2-savedmodel convert to tflite
- Detailed explanation of ArrayList expansion, expansion principle [easy to understand]
- What data capabilities do data product managers need to master?
猜你喜欢

Opencv Learning Notes 6 -- image mosaic

The State Administration of Chia Tai market supervision, the national development and Reform Commission and the China Securities Regulatory Commission jointly reminded and warned some iron ores

建立自己的网站(14)
![After twists and turns, I finally found the method of SRC vulnerability mining [recommended collection]](/img/ac/ab6053e6ea449beedf434d4cf07dbb.png)
After twists and turns, I finally found the method of SRC vulnerability mining [recommended collection]

Salesforce, Johns Hopkins, Columbia | progen2: exploring the boundaries of protein language models

The markdown editor uses basic syntax

【14. 区间和(离散化)】
![[dynamic programming] p1004 grid access (four-dimensional DP template question)](/img/3a/3b82a4d9dcc25a3c9bf26b6089022f.jpg)
[dynamic programming] p1004 grid access (four-dimensional DP template question)

Music player development example (can be set up)

音乐播放器开发实例(可毕设)
随机推荐
Error-tf. function-decorated function tried to create variables on non-first call
写在Doris毕业后的第一天
Semiconductor foundation of binary realization principle
TypeScript: let
C#学习笔记(5)类和继承
【阶段人生总结】放弃考研,参与到工作中,已经顺利毕业了,昨天刚领毕业证
JVM第一话 -- JVM入门详解以及运行时数据区分析
JVM performance tuning and practical basic theory part II
[14. Interval sum (discretization)]
Detailed explanation of ArrayList expansion, expansion principle [easy to understand]
Yyds dry goods inventory hcie security day13: firewall dual machine hot standby experiment (I) firewall direct deployment, uplink and downlink connection switches
基于价值量化的需求优先级排序方法
leetcode:329. 矩阵中的最长递增路径
The first technology podcast month will be broadcast soon
这3款在线PS工具,得试试
TypeScript:const
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
Solid basic basic grammar and definition function
Word2vec yyds dry goods inventory
C learning notes (5) class and inheritance