集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1857|回复: 0

信号跨越两个时钟域外文资料

[复制链接]
20080067 发表于 2010-5-3 11:10:00 | 显示全部楼层 |阅读模式
信号跨越两个时钟域外文资料
A signal to another clock domainLet's say a signal from clkA domain is needed in clkB domain. It needs to be "synchronized" to clkB domain, so we want to build a "synchronizer" design, which takes a signal from clkA domain, and creates a new signal into clkB domain.

In this first design, we assume that the signal-in changes "slowly" compared to both clkA and clkB clock speeds.
Typically all you need to do is to use two flip-flops to move the signal from clkA to clkB (to learn why, get back to the links).
module Signal_CrossDomain(    clkA, SignalIn,     clkB, SignalOut);// clkA domain signalsinput clkA;input SignalIn;// clkB domain signalsinput clkB;output SignalOut;// Now let's transfer SignalIn into the clkB clock domain// We use a two-stages shift-register to synchronize the signalreg [1:0] SyncA_clkB;always @(posedge clkB) SyncA_clkB[0] <= SignalIn;      // notice that we use clkBalways @(posedge clkB) SyncA_clkB[1] <= SyncA_clkB[0]; // notice that we use clkBassign SignalOut = SyncA_clkB[1];  // new signal synchronized to (=ready to be used in) clkB domainendmoduleThe two flip-flops have the side-effect of delaying the signal.
For example, here are waveforms where you can see the slow moving signal being synchronized (and delayed) to clkB domain by the two flip-flops:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?我要注册

x
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-12-23 23:53 , Processed in 0.058234 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表