Abstract:
A circuit is described for automatically adjusting a phase of an input register load clock to be synchronized with transitions of data bits forming an n-bit word. The circuit detects the first transition of a data bit in the n-bit word. The circuit then time-shifts the input clock, to generate a shifted clock, so that a triggering edge of the shifted clock occurs sometime after generation of the transition detect signal, such as in the middle third of a data cycle. Shifting the input clock may be performed by multiplying the input clock to generate a plurality of sub-clock cycles and selecting one of the sub-clock cycles as the start of the shifted clock cycle. The parallel data are applied to inputs of input registers clocked using the shifted clock as the load clock. Thus, the load clock occurs at an optimum time near the middle of a data cycle.

Description:
FIELD OF THE INVENTION 
       [0001]    This invention relates to digital circuits that receive binary data signals along with a separate clock signal for sampling the data signals and, in particular, to a circuit feature that improves synchronization between the clock signal and the data signals. 
       BACKGROUND 
       [0002]      FIG. 1  illustrates a conventional digital circuit  10  that receives four data bits (D 0 -D 3 ) in parallel at four data input terminals, to form a 4-bit word, along with a clock at a fifth input terminal. The data is in non-return to zero (NRZ) code (no neutral states). The clock signal received by circuit  10  is typically the same clock signal used by the transmitter to clock out the data transmitted to the circuit  10 . 
         [0003]    In a typical circuit, the leading edge of the clock pulse acts as the trigger for input registers to store the data levels occurring at the time of the clock&#39;s leading edge. In  FIG. 1 , the input registers are D flip flops  12 - 15 . In a D flip-flop, the data clocked in is applied at the Q output of the flip-flop at the leading edge of the clock pulse. Ideally, the data communication system is designed so that the leading edge of the clock (which triggers the input registers) occurs at about the midpoint between the data transition times to ensure that all the parallel data bits during a single cycle have transitioned, if at all, for that cycle. 
         [0004]      FIG. 2A  illustrates an example of a properly aligned clock, where the triggering edge occurs at about the midpoint between the data transition times. Only two data bits, D 0  and D 1 , are shown for simplicity. If the propagation times were identical for all the data and clock paths, and the transmitter transmitted the clock and data signals with the alignment shown in  FIG. 2A , then all sampled data will be accurate at the outputs of the flip-flops  12 - 15  ( FIG. 1 ). As long as the leading edge of the clock occurs after all the data bits have transitioned, if at all, in a given data cycle, the 4-bit word stored in the registers will be accurate. Finite set-up and hold times of the data relative to the clock avoid metastable states but further reduce the valid data window. 
         [0005]    When different propagation delays occur in the data and clock paths, proper input register clocking is not assured. 
         [0006]      FIG. 2B  illustrates the same transmitted signals as in  FIG. 2A  but where the propagation times of the data and clock signals are not the same. This may be due to different conductor lengths for the data and clock signals, or different loads on the clock and data lines, or different processing of the clock and data signals. In  FIG. 2B , the leading edge of the clock signal has shifted outside of the valid data window due to different propagation delays during the transmission and/or reception of these three signals. Accordingly, in the example of  FIG. 2B , the leading edge of the clock will trigger the input registers to store the D0 and D1 bits from two different data cycles, resulting in an incorrect 4-bit word clocked into and out of the input registers. 
         [0007]    In the example of  FIG. 1 , the flip-flops  12 - 15  input the 4-bit word into a parallel-to-serial converter  18 . A phase locked loop (PLL) clock multiplier  20  multiplies the input clock by 4×. The 4× clock is then used to clock out the serial data from a shift register, forming the output section of the converter  18 , after each loading of a 4-bit word into the shift register. 
         [0008]    What is needed is a circuit technique that can adjust a clock signal for triggering an input register, where the triggering edge of the clock signal is properly aligned or synchronized with the data transitions even when the data and clock paths have different propagation delays. 
       SUMMARY 
       [0009]    In one embodiment of the invention, an input clock is received along with parallel data bits. The input clock signal is then multiplied by, for example, four. The data bits are detected for any transitions between any of the 4× clock cycles. Upon detection of a transition of any one of the data bits, the triggering edge of the input clock (for clocking input registers) is time-shifted to occur about two of the 4× clock periods after the first data transition (near the middle of the data cycle). This ensures that the transitioned bit is stored in the input register. Positioning the leading clock edge near the midpoint of the data cycle of the first transitioned data bit also greatly increases the likelihood that the remainder of the data will have transitioned, if at all, prior to the leading edge of the shifted clock edge, since it is likely that all the data bits have generally similar propagation delays. The shifted input clock triggers all the data input registers at the same time to temporarily store the 4-bit word until the word is clocked out at the start of the next clock cycle. The 4-bit word is then processed by a downstream circuit, such as a parallel-to-serial converter. 
         [0010]    In another embodiment, the clock may be shifted by any fraction of a data cycle after the first data transition. The multiplier of the input clock determines the precision of the location of the leading edge of the shifted input clock relative to the first data transition. 
         [0011]    In another embodiment, a simple controllable delay circuit shifts the input clock so that the triggering edge is synchronized with the first data transition. 
         [0012]    As seen, the shifted input clock is made synchronous with respect to the first transition of a data bit to be clocked so that the clock phase is optimum relative to the data cycle phase. This technique ensures valid data recovery irrespective of the input clock propagation delay relative to the data propagation delay. 
         [0013]    The invention may also be implemented where the triggering of registers occurs on the trailing edge of the clock. 
         [0014]    If the input registers output the data bits to a parallel-to serial converter, a multiplied clock is already needed for the converter to clock out the serial data from a shift register, and the multiplied clock signal may also be used for shifting the input clock for the input registers. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]      FIG. 1  illustrates a prior art circuit receiving data and clock signals. 
           [0016]      FIG. 2A  illustrates a properly aligned clock relative to the data signals. 
           [0017]      FIG. 2B  illustrates potential problems with the circuit of  FIG. 1  when the propagation delay of the clock signal is different from the propagation delays of the data signals. 
           [0018]      FIG. 3  illustrates high level circuit functions for carrying out one embodiment of the invention, where the invention is used for clocking a 4-bit word into a parallel-to-serial converter. 
           [0019]      FIG. 4  illustrates various signals in the circuit of  FIG. 3 , showing the desirable time-shifting of an input clock for clocking the data into input registers. 
           [0020]      FIG. 5  is a flowchart illustrating various steps used to carry out one embodiment of the invention. 
           [0021]      FIG. 6A  illustrates how to combine the circuit schematic portions of  FIGS. 6B-6E  and identifies the general functions of each of the circuit portions. 
           [0022]      FIGS. 6B-6E  together form a schematic diagram of one embodiment of the invention in conjunction with a parallel-to-serial converter for a 4-bit word. 
           [0023]      FIG. 7  illustrates examples of various signals generated in the circuit of  FIGS. 6B-6E . 
       
    
    
       [0024]    Elements labeled with the same numeral may be equivalent or identical. 
       DETAILED DESCRIPTION 
       [0025]      FIG. 3  illustrates one embodiment of a circuit for synchronizing a clock signal to data transitions to ensure valid data recovery. 
         [0026]    An upstream circuit (not shown) generates parallel NRZ data bits D 0 -D 3  during a data cycle. The upstream circuit or another circuit generates a clock signal (CLKin) that is intended to be used for clocking bits D 0 -D 3  into respective input registers for further processing of the data bits. It is assumed that the CLKin period is equal to the data cycle period, although the phases of the periods may be arbitrarily skewed relative to one another by different propagation delays. In the examples given, the leading edge of CLKin is used for triggering the input registers. The invention can also be applied to circuits where the trailing edge of the clock triggers the input registers. It is not necessary for the invention that the data bits use the NRZ code since any code using a clock can benefit from the present invention. 
         [0027]    The data bits D 0 -D 3  are applied to the inputs of input registers  24 . The registers  24  are shown as D-type flip-flops, where the D input becomes the Q output at the clock trigger. The Q output is therefore the D input delayed by up to one clock cycle. 
         [0028]    The CLKin signal is multiplied by any conventional multiplier  25 . In the example, the CLKin signal is multiplied by 4×. Such a multiplier  25  may be a digital phase-locked loop (PLL) multiplier, where the CLKin signal is applied to a non-inverting input of a phase detector (e.g., a differential amplifier or comparator). The output of the phase detector is connected to the input of a voltage controlled oscillator (VCO), whose output supplies the multiplied clock. As a negative feedback signal, the output of the VCO is divided by four and applied to the inverting input of the phase detector. The VCO will output a 4× clock signal so that the phases of the two input signals into the phase detector are matched. Any other well known clock multiplier can be used. 
         [0029]      FIG. 4  illustrates the CLKin waveform and the 4×CLKin waveform. Examples of the D0-D3 signals are also provided, showing arbitrary phase differences between the CLKin and data cycles due to differing propagation delays. Note that if the leading edge of the CLKin signal were used to clock the data bits into the input registers  24 , the data bits D 0  and D 2  would be from one data cycle and the data bit D 1  and D 3  would be from a different data cycle, resulting in incorrect 4-bit words being processed. 
         [0030]    A transition detector  26  outputs a transition detect signal whenever any one of the data bits D 0 -D 3  has transitioned states during a 4×CLKin cycle. This may be done by exclusive ORing a data bit clocked at the trailing edge of one 4×CLKin cycle with the data bit clocked at the trailing edge of the next 4×CLKin cycle. If the two bits are not 0,0 or 1,1, then a transition during the 4×CLKin cycle has occurred, and a transition detect signal is then generated. 
         [0031]    The transition detect signal is shifted by a half 4×CLKin cycle and then applied to a CLKin shifter  28 . The CLKin shifter  28  selects one of the 4×CLKin cycles that starts around the midpoint of the data cycle containing the transitioned bit and then generates a time-shifted CLKin signal having a leading edge starting at the beginning of the selected 4×CLKin cycle. In the example of  FIG. 4  using a 4×CLKin signal, the CLKin shifter  28  selects the first 4×CLKin cycle that occurs after the transition is detected as the start of the time-shifted CLKin signal. The CLKin shifter  28  could have instead selected the second 4×CLKin cycle after the transition was detected as the start of the time-shifted CLKin cycle and still obtained valid data. The time-shifted CLKin signal has the same period as the CLKin signal but has a phase selected based on the transition detect signal. As shown in  FIG. 4 , the CLKin shifter  28  effectively time-shifted the CLKin signal by two 4×CLKin cycles, which corresponds roughly to the midpoint of the data cycle. 
         [0032]    Since the phase of the time-shifted CLKin signal depends only on the transition detect signal, the phase of the incoming CLKin signal can be arbitrary, and the phase of the time-shifted CLKin will still be at roughly the midpoint of the data cycle. 
         [0033]    Since the clock multiplier  25  multiplied the CLKin by four times, the CLKin shifter  28  may use a 2-bit counter, clocked by the 4×CLKin signal, to generate the shifted CLKin signal having the same period as the CLKin signal but shifted in time based on the transition detect signal.  FIG. 6C  shows such a 2-bit counter that may be used in the CLKin shifter  28 . 
         [0034]    Approximately the midpoint of the data cycle was selected for the leading edge of the time-shifted CLKin signal to occur since all the other data bits would have transitioned, if at all, by that time. Typically, the data bits have similar propagation delay times. The term “approximately the midpoint” is deemed to be the middle third of a data cycle. 
         [0035]    In another embodiment, the clock multiplier  25  multiplies the CLKin by other than 4×. In one embodiment, the multiplied clock is 3×. In another embodiment, the multiplied clock is 5× or greater to provide additional precision in shifting the CLKin signal relative to the first data transition. 
         [0036]    The time-shifted CLKin signal is then used to clock the data bits D 0 -D 3  into the input registers  24 . 
         [0037]    The phrase “shifting the CLKin signal” refers to any phase adjustment of the CLKin signal by any means, such as by regeneration of the CLKin signal (e.g., using a counter) or actual delaying of the CLKin signal (using a delay circuit). The shifted CLKin signal may be considered to have been delayed or accelerated relative to the data cycle. If the CLKin shifter  28  were simply a controllable delay, such as a tapped series of inverters, the incoming CLKin signal may be applied directly to the CLKin shifter  28 , as shown by the dashed line in  FIG. 3   
         [0038]    In the example of  FIG. 3 , the input registers  24  are inputs into a parallel-to-serial converter  32 . Since the converter  32  loads each 4-bit word in parallel and outputs the 4 bits serially, the converter  32  uses a load clock  34  and a 4× serial clock. In one embodiment, the load clock  34  output is the same as the shifted CLKin signal but delayed by one 4×CLKin cycle to avoid any metastable states. The leading edge of the load clock loads the 4-bit word output from the input registers  24  into the converter  32 . The multiplier  25  generates the 4× serial clock that clocks the serial bits out of a shift register that is loaded with the 4-bit word at the leading edge of the load clock. The 4×CLKin signal then shifts the data bits out serially. 
         [0039]    In one embodiment, the clock synchronization circuit of  FIG. 3  is part of a 2.5 GPON (gigabit passive optical network) single chip transceiver, where the parallel data is loaded at 312.5 Mbps (in parallel format) and the serial data is clocked out at 1.25 Gbps. Any other clock frequencies, such as 1 KHz-10 GHz, may be used. 
         [0040]      FIG. 5  is a flowchart summarizing the technique to synchronize the clock with a data transition. In step  40 , the circuit receives the CLKin signal along with data signals, forming an n-bit word. The invention, however, may be used for circuits processing only one data bit at a time. 
         [0041]    In step  41 , a state transition is detected in the data. 
         [0042]    In step  42 , a time-shifted CLKin signal is generated with a triggering edge shifted with respect to the CLKin triggering edge so as to occur some time after the transition of the data. In one embodiment, the triggering edge of the CLKin signal is time-shifted to occur approximately in the middle of a data cycle to maximize the likelihood that all data bits in the n-bit word will have transitioned, if at all, prior to the triggering edge of the time-shifted CLKin signal, regardless of when the triggering edge of the incoming CLKin signal occurs. 
         [0043]    In step  43 , the input registers for the incoming data are clocked with the time-shifted CLKin to stored the n-bit word. 
         [0044]    In step  44 , the n-bit word is clocked out of the input registers for being further processed by downstream circuitry, such as a parallel-to-serial converter or other circuit. 
         [0045]      FIGS. 6A-6E  illustrate an actual embodiment of the circuit of  FIG. 3 . One skilled in the art will understand the operation of the circuit of  FIGS. 6A-6E  by the following brief description of the overall function of the circuit and the functions of the various components. The functional description is the same as that for  FIG. 3 . The parallel-to-serial portion of the circuit and its clocking are not relevant to the basic invention but are described for completeness. 
         [0046]      FIG. 6A  illustrates how the  FIGS. 6B-6E  are to be arranged and summarizes the functions of each of the circuit blocks. 
         [0047]      FIG. 6B  illustrates the transition detector  26 . D flip-flops  50  receive the D0-D3 data bits and are clocked with the trailing edge of the 4×CLKin signal output from a clock multiplier. An exclusive OR (XOR) gate  52  for each data bit detects if the data bit has changed state since the previous 4×CLKin clock cycle. The outputs of each XOR gate are connected to an OR gate  54 . If any one data bit changes state since the previous clock cycle, the OR gate  54  outputs a high transDet1 signal to a latch  56 . The 4×CLKin signal enables the latch  56  one-half cycle after the transition is detected, since the latch  56  is enabled by the leading edge of the 4×CLKin signal. The latch  56  then asserts the signal transDet 2 . 
         [0048]    The transDet2 signal is applied to an OR gate  58  in the 2-bit counter of  FIG. 6C  (which is the CLKin shifter  28  in  FIG. 3 ). The high transDet2 signal is output from the OR gate  58  and applied to the D flip-flop  60 . The D flip-flop  60  outputs a high clock signal after the next 4×CLKin cycle, so the high output of the D flip-flop  60  occurs between 1.5 and 2.5 clock periods after the actual transition of a data bit (it is not known where within a 4×CLKin cycle a data bit transitions). The output of the D flip-flop  60  is labeled ck_reg 1 . 
         [0049]    The leading edge of the c_reg1 signal clocks the input registers  64  in  FIG. 6D  for storing all the data bits D 0 -D 3  between 1.5 and 2.5 clock periods after the actual transition of a data bit. This is around the midpoint of the data cycle for the transitioned data bit, since a data cycle is four of the 4×CLKin cycles. 
         [0050]    The feedback loop of the 2-bit counter of  FIG. 6C , including D flip-flop  61  and OR gate  58 , causes the ck_reg1 signal to remain high for two of the 4×CLKin cycles and low for the next two 4×CLKin cycles. This results in the ck_reg1 clock to have the same frequency as the CLKin signal. 
         [0051]    The AND gate  62  in  FIG. 6C  outputs a short pulse (signal labeled load_reg 1 ), of a single 4×CLKin cycle, for controlling the loading of the 4-bit word from the input registers  64  ( FIG. 6D ) into the D flip-flops  68  (acting as a 4-bit shift register) in the parallel-to-serial converter  32  of  FIG. 6D . Note that the load_reg1 pulse has a leading edge that occurs at the same time as the leading edge of the ck_reg1 pulse that controls the input registers  24 . To ensure that the outputs of the input registers  24  are stable at the time of the loading of the 4-bit word into the D flip-flops  68 , a load_reg2 signal, for triggering the loading of the 4-bit word into the D flip-flops  68 , is generated one 4×CLKin cycle after the load_reg1 pulse. The 2-bit counter and encoder of  FIG. 6E  generates the load_reg2 clock. The circuit of  FIG. 6E  is optional if there is no problem with loading the shift register at the same time the input registers  24  are triggered. 
         [0052]    The load_reg2 pulse ( FIG. 6D ) controls the 2:1 multiplexers  70  to select the A1 input, which is the output of the input registers  24 , for loading the 4-bit word into the D flip-flops  68 . The D flip-flops  68  are clocked using the 4×CLKin signal. 
         [0053]    After the short load_reg2 pulse, the multiplexers  70  then pass the AO input signal to their associated D flip-flops  68 . The D flip-flops  68  are controlled by the 4×CLKin clock so that they are loaded at the leading edge of the load_reg2 pulse, then shift the bits through the multiplexers  70  and other D flip-flops  68  in the chain until the data bits are shifted out to the serial port  78 . 
         [0054]      FIG. 7  illustrates examples of waveforms, described below, that may occur in the circuit of  FIGS. 6A-6E . 
         [0055]    The 4×CLKin signal is generated by a multiplier from the received CLKin signal. 
         [0056]    D 0  and D 1  are examples of two of the data bits, where the data cycles for the two bits are shown skewed relative to each other so that they transition at slightly different times. 
         [0057]    The “Data” waveform illustrates the valid window in which both the D0 and D1 signals can be clocked into the input registers  24  so that the states of the D0 and D1 bits in a 4-bit word are accurate. 
         [0058]    The tr0 and tr1 signals are the transition detect signals from the D0 and D1 bit paths applied to the OR gate  54  in  FIG. 6B . 
         [0059]    The transDet1 signal is the output of the OR gate  54  in  FIG. 6B  pursuant to the transitions of the D0-D3 signals. 
         [0060]    The transDet2 signal is the output of the latch  56  in  FIG. 6B , which lags the transDet1 signal by one-half clock cycle. 
         [0061]    The Q1 signal is the Q output of the D flip-flop  60  in  FIG. 6C , which is the ck_reg1 signal that clocks the input registers  24  at the CLKin frequency but with a phase synchronized with the first transition of the data bits in a data cycle. Note that the triggering edge of the Q1 pulse occurs during the valid window of the data bits and approximately at the midpoint of the D0 data cycle. 
         [0062]    The inverse Q2 signal is the inverted output of the D flip-flop  61  in  FIG. 6C . 
         [0063]    The load_reg1 signal is the output of the AND gate  62  in  FIG. 6C . To ensure that the outputs of the input registers  24  are stable at the time of the loading of the 4-bit word into the shift register of the parallel-to-serial shift converter  32 , the load_reg2 signal, for triggering the loading of the 4-bit word into the shift register, occurs one 4×CLKin cycle after the load_reg1 pulse. 
         [0064]    In one embodiment, the entire circuitry of  FIG. 3  or  FIGS. 6A-6E  is formed as a part of an integrated circuit. 
         [0065]    The invention is applicable to any input circuit receiving a clock signal along with one or more data bits. 
         [0066]    Having described the invention in detail, those skilled in the art will appreciate that, given the present disclosure, modifications may be made to the invention without departing from the spirit and inventive concepts described herein. Therefore, it is not intended that the scope of the invention be limited to the specific embodiments illustrated and described.