zoukankan      html  css  js  c++  java
  • 多时钟系统1 Crossing clock domains Signal

    Crossing clock domains - Signal

    from:http://www.fpga4fun.com/CrossClockDomain1.html
    A signal to another clock domain

    Let'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 signals
    input clkA;
    input SignalIn;
    
    // clkB domain signals
    input clkB;
    output SignalOut;
    
    // Now let's transfer SignalIn into the clkB clock domain
    // We use a two-stages shift-register to synchronize the signal
    reg [1:0] SyncA_clkB;
    always @(posedge clkB) SyncA_clkB[0] <= SignalIn;      // notice that we use clkB
    always @(posedge clkB) SyncA_clkB[1] <= SyncA_clkB[0]; // notice that we use clkB
    
    assign SignalOut = SyncA_clkB[1];
    endmodule
    

    The 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:



    >>> NEXT: Crossing clock domains - Flag >>>




  • 相关阅读:
    JAVA流和File类
    JAVA的Socket
    JAVA反射
    JAVA线程
    JAVA集合
    052-214(新增70题2018)
    052-213(新增70题2018)
    052-212(新增70题2018)
    052-211(新增70题2018)
    052-210(新增70题2018)
  • 原文地址:https://www.cnblogs.com/xinjie/p/1522794.html
Copyright © 2011-2022 走看看