WO2019184395A1 - Flip-flop and integrated circuit - Google Patents
Flip-flop and integrated circuit Download PDFInfo
- Publication number
- WO2019184395A1 WO2019184395A1 PCT/CN2018/116241 CN2018116241W WO2019184395A1 WO 2019184395 A1 WO2019184395 A1 WO 2019184395A1 CN 2018116241 W CN2018116241 W CN 2018116241W WO 2019184395 A1 WO2019184395 A1 WO 2019184395A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- latch
- output
- inverter
- signal
- detecting
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K3/00—Circuits for generating electric pulses; Monostable, bistable or multistable circuits
- H03K3/02—Generators characterised by the type of circuit or by the means used for producing pulses
- H03K3/027—Generators characterised by the type of circuit or by the means used for producing pulses by the use of logic circuits, with internal or external positive feedback
- H03K3/037—Bistable circuits
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K3/00—Circuits for generating electric pulses; Monostable, bistable or multistable circuits
- H03K3/02—Generators characterised by the type of circuit or by the means used for producing pulses
- H03K3/353—Generators characterised by the type of circuit or by the means used for producing pulses by the use, as active elements, of field-effect transistors with internal or external positive feedback
- H03K3/356—Bistable circuits
Definitions
- the present application relates to the field of electronic technologies, and in particular, to a flip-flop and an integrated circuit.
- a flip-flop is an information storage device with a memory function and is a basic logic unit constituting a plurality of sequential circuits.
- Figure 1 shows a D type flip-flop (DFF). Where din represents the input data signal, clk represents the input clock signal, dout represents the output signal, and rst represents the reset signal.
- the D flip-flop shown in Figure 1 is a rising edge triggered D flip-flop. The rising edge of the clock signal triggers the level state of the D flip-flop latch input signal and then outputs the latched level through the Q pin. .
- a time window is defined near the rising edge of the clock signal, and in principle, the data signal din input in the time window should not be level-inverted. If the level flip occurs in the din window during this time window, some nodes in the D flip-flop may not be stable in the logic 0 or logic 1 level state, resulting in the output signal dout after the rising edge of the clock signal. It is in an indeterminate state for a period of time, that is, metastable state. The time during which the output signal dout is in an indeterminate state is referred to as a resolution time. After the decision time, the output signal dot will be randomly stabilized at 0 or 1.
- FIG. 2 it is a timing diagram of input and output signals of a D flip-flop.
- the input data signal din is level-inverted within a defined time window
- the output signal dout is in an intermediate level state between logic 0 and logic 1 for a period of time (Tmet), and finally stabilizes at logic 1.
- the output signal is finally randomly stabilized at logic 0 or logic 1, which causes a logical misjudgment of the output signal.
- the indeterminate state of the output signal during the decision time will also cause the next-stage circuit to produce metastable state, which affects the normal operation of the entire system.
- the trigger provided by the prior art may exhibit a metastable state, which leads to a logic misjudgment and a problem that the system cannot work normally.
- the embodiment of the present application provides a flip-flop and an integrated circuit for reducing the probability of a metastable phenomenon of a trigger, preventing a logical misjudgment of the output signal of the trigger, and affecting normal operation of the system.
- an embodiment of the present application provides a trigger for latching and outputting an input data signal under control of a first clock signal, the trigger including: a first latch, a second lock a buffer, a delay unit, a detection unit, a switching unit, and a third latch. among them,
- a delay unit configured to delay and output the second clock signal after delaying the first clock signal by a preset time.
- the clock signal input end of the first latch is coupled to the delay unit to receive the second clock signal; the first latch is configured to latch or output the data signal according to the second clock signal.
- the second latch is configured to latch or output the data signal according to the first clock signal.
- the detecting unit is configured to detect whether the first latch or the second latch is in a metastable state, and send a control signal to the switching unit based on the detection result.
- the switching unit is configured to select an output signal of the first latch or an output signal of the second latch according to the control signal.
- the data input end of the third latch is connected to the output end of the switching unit for latching or outputting the output signal of the switching unit according to the first clock signal.
- the switching unit can be implemented by a data selector having two input signals.
- the time at which the data signal input in the flip-flop is level-reversed If it is in the time window of the first clock signal (ie, the second latch is in metastable state), it is usually not in the time window of the second clock signal (ie, the first latch is not in metastable state) ).
- the data signal input in the flip-flop is level-inverted, if it is in the time window of the second clock signal (ie, the first latch is in metastable state), it is usually not in the first clock signal. Within the time window (ie the second latch is not in metastable state). Therefore, the first latch and the second latch are not simultaneously metastable.
- the switching unit when the detecting unit detects that the first latch is in a metastable state, the switching unit may select to output an output signal of the second latch according to the control signal; When the two latches are in metastability, the switching unit can select to output an output signal of the first latch according to the control signal. Therefore, by using the flip-flop provided by the first aspect, the signal output to the input end of the third latch can be in a stable state, so that the output signal of the flip-flop is in a stable state, and the probability of a metastable phenomenon of the flip-flop is reduced. In order to avoid the logic output of the trigger output signal, affecting the normal operation of the system.
- the preset time may be set as follows: the preset time is greater than a sum of a setup time and a hold time of the first latch, and is smaller than a signal period of the first clock signal.
- the preset time since the phase difference between the first clock signal and the second clock signal is greater than the time window of the first clock signal (ie, the sum of the setup time and the hold time), and is smaller than the first clock signal Half of the signal period, and thus the time at which the data signal input by the flip-flop is level-flip cannot be simultaneously within the time window of the first clock signal and the time window of the second clock signal. That is to say, the first latch and the second latch are not simultaneously metastable, and the switching unit can certainly select when outputting the output signal of the first latch and the output signal of the second latch. Select a stable signal and output. Therefore, in the case where the preset time is set as above, the probability that the trigger exhibits a metastable state can be further reduced.
- the preset time is shorter than the signal period of the first clock signal, so that the delay of the second clock signal compared to the first clock signal can be made smaller (less than the signal period of the first clock signal). That is, when the second latch generates a metastable state and the switching unit selects the output signal of the first latch, the delay time of the output signal of the first latch compared to the output signal of the second latch Smaller, so that the output signal delay time of the entire flip-flop is smaller, and the delay time is smaller than the signal period of the first clock signal.
- the switching unit when the switching unit selectively outputs the output signal of the first latch or the output signal of the second latch according to the control signal, the switching unit may be implemented as follows: the switching unit determines the first in the detecting unit When the latch is in metastable state, the output signal of the second latch is selected to be output; or, the switching unit selects to output the output signal of the first latch when the detecting unit determines that the second latch is in metastability.
- the signal output from the switching unit to the input end of the third latch can be in a stable state, so that the output signal of the flip-flop is in a stable state, and the probability of the metastable phenomenon of the flip-flop is reduced.
- the detection unit is operative to detect if the first or second latch is in a metastable state.
- the detecting unit can have two specific implementations when detecting whether the first latch or the second latch is in a metastable state. The following two implementations are introduced separately.
- the detecting unit is configured to detect whether the first latch or the second latch is in a metastable state, specifically, the detecting unit detects the first latch or the second latch Check if the node is metastable.
- the detecting unit detects whether one of the first latch and the second latch is metastable.
- the control signal also only indicates if a particular latch is in a metastable state.
- the switching unit may select: outputting the output signal of the other latch when the currently detected latch is in metastability
- the output signal of the currently detected latch is selected to be output when the currently detected latch is not in metastability.
- the detecting unit may include a first inverter, a second inverter, and a first exclusive OR gate circuit. among them,
- the first inverter is connected to the detecting node for outputting a low level when the voltage of the detecting node is greater than or equal to the first threshold, and outputting a high level when the voltage of the detecting node is lower than the first threshold.
- a second inverter connected to the detecting node, configured to output a low level when the voltage of the detecting node is greater than or equal to the second threshold, and output a high level when the voltage of the detecting node is lower than the second threshold, the second threshold Less than the first threshold.
- a first XOR gate circuit coupled to the first inverter and the second inverter for performing an exclusive OR operation on an output signal of the first inverter and an output signal of the second inverter, and The result of the operation is output as a control signal to the switching unit.
- the first XOR gate circuit when the latch in which the detecting node is located is in metastable state, the first XOR gate circuit outputs a high level; when the latch in which the detecting node is located is not in metastability, the first XOR gate circuit The output is low. Therefore, the level state of the control signal output by the detecting unit can represent whether the latch in which the detecting node is located is metastable, so that the switching unit can selectively output the output signal of the first latch according to the control signal or The output signal of the second latch.
- the structure of the first latch can have the following two forms:
- the first latch includes a first clocked inverter, a second clocked inverter, and a third inverter; an input of the first clocked inverter inputs a data signal, and the first clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the third inverter; the signal outputted by the output end of the third inverter is used as an output signal of the first latch; the second clocked inverter The input end is connected to the output end of the third inverter, and the output end of the second clocked inverter is connected to the output end of the first clocked inverter; wherein the first clocked inverter and the second clock The control inverter is alternately turned on under the second clock signal.
- the switching unit selects and outputs the output signal of the second latch.
- the decision time of the first latch ends, the first latch will eventually stabilize at logic 0 or logic 1 randomly.
- the detecting unit detects that the first latch is not in metastable state, the switching unit will The output signal of the first latch is selected to be output according to a control signal output from the detecting unit. That is, the second latch outputs a signal to the third latch instead of the first latch when the first latch is in metastability, and the second latch when the first latch returns to steady state.
- the device does not work.
- the first latch includes a first clocked inverter, a second clocked inverter, and a third inverter; an input of the first clocked inverter inputs a data signal, and the first clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the third inverter; the signal outputted by the output end of the third inverter is used as an output signal of the first latch; the second clocked inverter The input end is connected as the feedback end of the first latch to the output end of the switching unit, and the output end of the second clocked inverter is connected to the output end of the first clocked inverter; wherein, the first clocked reverse The phase comparator and the second clocked inverter are alternately turned on under the second clock signal.
- the feedback terminal can feed back the stable level to the detecting node
- the second structure is adopted, and the metastability of the detecting node can be detected in a shorter time than the first structure of the first latch.
- the switching unit can switch after the metastable state is removed, and select the output signal of the output first latch.
- the structure of the second latch can have the following two forms:
- the second latch includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter; the input of the third clocked inverter inputs a data signal, and the third clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the fourth inverter; the signal outputted by the output end of the fourth inverter is used as an output signal of the second latch; the fourth clocked inverter The input end is connected to the output end of the fourth inverter, and the output end of the fourth clocked inverter is connected to the output end of the third clocked inverter; wherein the third clocked inverter and the fourth clock The control inverter is alternately turned on under the first clock signal.
- the switching unit selects and outputs the output signal of the first latch.
- the second latch will eventually stabilize at logic 0 or logic 1 randomly.
- the detecting unit detects that the second latch is not in metastable state, the switching unit will The output signal of the second latch is outputted according to the detection result of the detecting unit. That is, the first latch outputs a signal to the third latch instead of the second latch when the second latch is in metastability, and the first latch when the second latch returns to steady state.
- the device does not work.
- the second latch includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter; the input of the third clocked inverter inputs a data signal, and the third clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the fourth inverter; the signal outputted by the output end of the fourth inverter is used as an output signal of the second latch; the fourth clocked inverter The input end is connected as the feedback end of the second latch to the output end of the switching unit, and the output end of the fourth clocked inverter is connected to the output end of the third clocked inverter; wherein, the third clocked reverse The phase comparator and the fourth clocked inverter are alternately turned on under the first clock signal.
- the feedback terminal can feed back the stable level to the detecting node
- the second structure is adopted, and the metastability of the detecting node can be detected in a shorter time than the first structure of the second latch.
- the switching unit can switch after the metastable state is removed, and select the output signal of the output second latch.
- the detecting unit when the detecting unit detects whether the first latch or the second latch is in metastability, the detecting unit is configured to: detect whether the first detecting node in the first latch is in Metastable, and detecting whether the second detected node in the second latch is in metastable state.
- the detecting unit detects whether the first latch and the second latch are in a metastable state.
- the control signal indicates whether the first latch is in a metastable condition and whether the second latch is in a metastable state.
- the switching unit may select to output the output signal of the second latch when the first latch is in metastability, Afterwards, the output signal of the second latch is selected and outputted until the control signal indicates that the second latch is in metastable state, and the output signal of the first latch is selected to be output; likewise, the second latch is at In the metastable state, the output signal of the first latch is selected, and then the output signal of the first latch is selected until the control signal indicates that the first latch is in metastable state, and the second latch is selected for output. Output signal of the device.
- the switching unit selects and outputs the output signal of the first latch or the output signal of the second latch. When it is, the number of switching signals is reduced.
- the detecting unit includes a first detecting circuit and a second detecting circuit.
- the first detecting circuit is configured to detect whether the first detecting node is in a metastable state, and send the first to the switching unit based on the detection result.
- a second detection circuit is configured to detect whether the second detection node is in a metastable state, and send a second control signal to the switching unit based on the detection result; wherein the control signal includes the first control signal and the second control signal.
- the first control signal is used to indicate whether the first latch is in a metastable state
- the second control signal is used to indicate whether the second latch is in a metastable state
- the first detecting circuit includes: a first inverter connected to the first detecting node, configured to output a low level when the voltage of the first detecting node is greater than or equal to the first threshold, and Outputting a high level when the voltage of the first detecting node is lower than the first threshold; and connecting the second inverter to the first detecting node, and outputting the low power when the voltage of the first detecting node is greater than or equal to the second threshold Leveling, and outputting a high level when the voltage of the first detecting node is lower than the second threshold, the second threshold is less than the first threshold; the first XOR gate circuit is connected to the first inverter and the second inverter, And performing an exclusive OR operation on the output signal of the first inverter and the output signal of the second inverter, and outputting the result of the exclusive OR operation as a first control signal to the switching unit;
- the second detecting circuit includes: a third inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the third threshold, and a voltage lower than the second detecting node a third threshold is outputting a high level; a fourth inverter is coupled to the second detecting node for outputting a low level when the voltage of the second detecting node is greater than or equal to a fourth threshold, and at the second detecting node When the voltage is lower than the fourth threshold, the high level is output, and the fourth threshold is smaller than the third threshold; the second exclusive OR circuit is connected to the third inverter and the fourth inverter, and is used for the third inverter The output signal and the output signal of the fourth inverter are XORed, and the result of the exclusive OR operation is output as a second control signal to the switching unit.
- the first XOR gate circuit since the second threshold is smaller than the first threshold, the first XOR gate circuit outputs a high level when the first latch is in a metastable state; when the first latch is not in a metastable state, The first XOR gate outputs a low level. Therefore, the level state of the first control signal output by the first detecting circuit can be used to indicate whether the first latch is in a metastable state; likewise, since the fourth threshold is less than the third threshold, when the second latch is in At metastability, the second XOR gate outputs a high level; when the second latch is not in a metastable state, the second XOR gate outputs a low level.
- the level state of the second control signal output by the second detecting circuit can indicate whether the second latch is in metastable state.
- the switching unit may selectively output an output signal of the first latch or an output signal of the second latch according to the first control signal and the second control signal.
- an embodiment of the present application provides an integrated circuit comprising the flip-flop provided in the above first aspect and any possible implementation manner thereof.
- FIG. 1 is a schematic diagram of a D flip-flop provided by the prior art
- FIG. 2 is a timing diagram of input and output signals of a D flip-flop provided by the prior art
- FIG. 3 is a schematic diagram of an internal structure of a D flip-flop according to an embodiment of the present disclosure
- FIG. 4 is a schematic structural diagram of a trigger system according to an embodiment of the present application.
- FIG. 5 is a timing diagram of input and output signals of a trigger system according to an embodiment of the present disclosure
- FIG. 6 is a timing diagram of input and output signals of another trigger system according to an embodiment of the present disclosure.
- FIG. 7 is a schematic structural diagram of a first type of trigger provided by an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a second type of trigger provided by an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of a third trigger provided by an embodiment of the present application.
- FIG. 10 is a schematic structural diagram of a fourth trigger provided by an embodiment of the present application.
- FIG. 11 is a schematic structural diagram of a fifth trigger provided by an embodiment of the present application.
- FIG. 12 is a schematic structural diagram of a sixth trigger provided by an embodiment of the present application.
- FIG. 13 is a schematic structural diagram of a seventh trigger provided by an embodiment of the present application.
- FIG. 14 is a schematic structural diagram of an eighth trigger provided by an embodiment of the present application.
- a D flip-flop can consist of a low pass latch and a high pass latch, as shown in FIG.
- the low-pass latch contains two clocked inverters (ie, first clocked inverter I1 and second clocked inverter I2) and one inverter (I3), high-pass latch
- the controller includes two clocked inverters (a third clocked inverter I4 and a fourth clocked inverter I5) and an inverter (I6).
- I3 and I6 are always in the on state, I1 and I5 are turned on when the clock signal is low, and I2 and I4 are turned on when the clock signal is high.
- the flip-flop works as follows: When the input clock signal is low, the low-pass latch transfers the logic value of input D to node A and then to node B. At this time, I2 and I4 are turned off, and the data latched on the rising edge of the previous clock signal is held on the node C of the high-pass latch, and the data is transmitted to the output terminal Q of the flip-flop.
- the input clock signal goes high, I1 and I5 are turned off, I2 and I4 are turned on, I2 and I3 of the low-pass latch are latched, and the high-pass latch transfers the logic value of input B to node C.
- the node C data is updated and then transmitted to the node Q, that is, the process of transferring the logical value of the input terminal D to the output terminal Q of the flip-flop.
- the D flip-flop shown in FIG. 3 is a rising edge triggered D flip-flop, that is, the rising edge of the clock signal triggers the level state of the data signal input by the flip-flop latch, and then passes through the Q tube. The level at which the foot output is acquired.
- the low-pass latch transmits the signal when the clock signal is low, by configuring the turn-on characteristics of I1 and I2.
- the high-pass latch transmits the signal when the clock signal is high, by configuring I4.
- I5 the conduction characteristics of I5 are realized.
- I1 and I5 are configured as clocked inverters that are turned on at a high level
- I2 and I4 are configured as clocked inverters that are turned on at a low level.
- the latches composed of I1, I2 and I3 can be high-pass latches; if the conduction characteristics of I4 and I5 are different from those of Figure 3 (for example, I4 is configured as a high-level
- the clocked inverter is configured to configure I5 as a low-level clocked inverter.
- the latches of I4, I5, and I6 can be low-pass latches. At this time, the falling edge triggered D flip-flop can be realized by I1, I2, I3, I4, I5 and I6, and its working principle is similar to that of the rising edge triggered D flip-flop, and will not be described here.
- a time window is defined near the rising edge of the clock signal, and if the data signal din input on the time window is level-inverted, it may result in Some nodes in the D flip-flop cannot be stabilized at the logic 0 or logic 1 level state, resulting in a meta-stable phenomenon of the D flip-flop.
- the time window may be composed of a setup time before the rising edge (ie, Ts in FIG. 2) and a hold time after the rising edge (ie, Th in FIG. 2). That is to say, in the Ts time before the rising edge of the clock signal and the Th time after the rising edge comes, the data signal din input in principle is not allowed to be level-inverted. If the data signal din is level-over at any time in Ts or Th, the trigger will appear metastable.
- multiple D flip-flops can be cascaded. As shown in FIG. 4, it is a trigger system that avoids metastable phenomena by cascading three D flip-flops.
- the first-stage D flip-flop appears metastable, since the output of the first-stage D flip-flop will eventually stabilize at logic 0 or logic 1, then the second-level D flip-flop or the third-level D-trigger
- the receiver eliminates metastability after receiving a stable logic level.
- the input and output timing diagram of the trigger system can be as shown in FIG.
- the first-stage D flip-flop since the input data signal of the first-stage D flip-flop is level-inverted during the time window of the rising edge of the first clock signal, the first-stage D flip-flop exhibits a metastable state. After the decision time of the first stage D flip-flop, the first stage D flip-flop settles to logic 1 before the rising edge of the second clock signal. Since the input signal of the second stage D flip-flop does not level flip during the time window of the rising edge of the second clock signal, the metastable state can be eliminated in the second stage D flip-flop.
- the input and output timing diagram of the trigger system can be as shown in FIG. 6.
- the first-stage D flip-flop since the input data signal of the first stage D flip-flop is level-inverted during the time window of the rising edge of the first clock signal, the first-stage D flip-flop exhibits a metastable state.
- the first stage D flip-flop is still in the decision time when the rising edge of the second clock signal arrives, so the first stage D flip-flop is still metastable when the rising edge of the second clock signal arrives, and the second stage D flip-flop remains There is a metastable state.
- the output of the second stage D flip-flop settles to logic 1 before the rising edge of the third clock signal. Since the input signal of the third-stage D flip-flop does not level flip during the time window of the rising edge of the third clock signal, the metastable state can be eliminated in the third-stage D flip-flop.
- the embodiment of the present application provides a flip-flop and an integrated circuit, which are used to reduce the probability of a metastable phenomenon of a trigger, avoid logical misjudgment of the trigger output signal, and affect the normal operation of the system.
- FIG. 7 is a schematic structural diagram of a flip-flop according to an embodiment of the present application, for latching and outputting an input data signal under control of a first clock signal.
- the flip-flop 700 includes a first latch 701, a second latch 702, a delay unit 703, a detecting unit 704, a switching unit 705, and a third latch 706. among them,
- the delay unit 703 is configured to delay and output the second clock signal after delaying the first clock signal by a preset time.
- the clock signal input end of the first latch 701 is connected to the delay unit 703 to receive the second clock signal; the first latch 701 is configured to input the data signal to the data input end of the flip-flop 700 according to the second clock signal. Perform latching or output.
- the second latch 702 is configured to latch or output a data signal input to the data input terminal of the flip-flop 700 according to the first clock signal.
- the detecting unit 704 is configured to detect whether the first latch 701 or the second latch 702 is in a metastable state, and transmit a control signal to the switching unit 705 based on the detection result.
- the two input ends of the switching unit 705 are respectively connected to the output end of the first latch 701 and the output end of the second latch 702, and the switching unit 705 is configured to selectively output the output of the first latch 701 according to the control signal.
- the data input end of the third latch 706 is coupled to the output of the switching unit 705 for latching or outputting the output signal of the switching unit 705 according to the first clock signal.
- the detecting unit 704 detects whether the first latch 701 or the second latch 702 is in a metastable state, and may have two specific meanings: Whether one of the first latch 701 or the second latch 702 is in a metastable state is detected; second, the detecting unit 704 simultaneously applies the first latch 701 and the second latch 702. Whether the two latches are in a metastable state is detected.
- the flip-flop 700 shown in FIG. 7 it is shown that the detecting unit 704 detects only whether the first latch 701 is in a metastable state, or the detecting unit 704 detects only whether the second latch 702 is in a metastable state. The situation (indicated by the dotted line). In actual implementation, the detecting unit 704 can also detect whether the first latch 701 is in a metastable state and whether the second latch 702 is in a metastable state.
- the conduction characteristics of the first latch 701 and the second latch 702 are the same, and the conduction characteristics of the third latch 706 and the first latch 701 (ie, The conduction characteristics of the second latch 702 are reversed.
- the first latch 701 transmits a signal when the clock signal is high
- the second latch 702 also transmits a signal when the clock signal is high
- the third latch 706 is low at the clock signal.
- the signal is transmitted at level; that is, the first latch 701 and the second latch 702 are high pass latches and the third latch 706 is a low pass latch.
- the second latch 702 also transmits a signal when the clock signal is low, and the third latch 706 is high at the clock signal.
- the signal is transmitted at the level; that is, the first latch 701 and the second latch 702 are low pass latches, and the third latch 706 is a high pass latch.
- the second latch 702 may exhibit a metastable state, and some of the second latch 702 The node cannot be stable at the logic 0 or logic 1 level state. If the time at which the input data signal is level-inverted is within the time window of the second clock signal, the first latch 701 may exhibit a metastable state, and some nodes in the first latch 701 cannot be stabilized. The level state of logic 0 or logic 1.
- the detecting unit 704 may determine that the first latch 701 is in a metastable state; the detecting unit 704 Upon detecting that some of the nodes of the second latch 702 are in an intermediate level state between logic 0 and logic 1, then it may be determined that the second latch 702 is in a metastable state.
- the clock signal used by the second latch 702 is the first clock signal of the input flip-flop 700
- the clock signal used by the first latch 701 is the first clock signal.
- the second clock signal obtained after the delay unit 703 is delayed. Since there is a phase difference between the first clock signal and the second clock signal, it is not difficult to see that the time at which the data signal input in the flip-flop 700 is level-reversed is within the time window of the first clock signal (ie, the second lock) 702 is in metastable state and is typically not within the time window of the second clock signal (ie, first latch 701 is not in metastable state).
- the time at which the data signal input in the flip-flop 700 is level-inverted is normally not in the first time if it is within the time window of the second clock signal (ie, the first latch 701 is in metastable state). Within the time window of the clock signal (ie, the second latch 702 is not in metastable state).
- first latch 701 and the second latch 702 are typically not simultaneously metastable.
- the switching unit 705 selects and outputs the output signal of the second latch 702; when detecting that the second latch 702 is in the metastable state, the switching unit 705 selects and outputs the output signal of the first latch 701.
- the switching unit 705 can be implemented by a data selector.
- the signal output to the input terminal of the third latch 706 can be made to be in a steady state, so that the output signal of the flip-flop 700 is in a steady state, reducing the probability that the flip-flop 700 exhibits a metastable state.
- the preset time delayed by the delay unit 703 may be greater than the sum of the setup time and the hold time of the first latch 701 and less than the signal period of the first clock signal.
- the preset time since the phase difference between the first clock signal and the second clock signal is greater than the time window of the first clock signal (ie, the sum of the setup time and the hold time), and is smaller than the first clock signal Half of the signal period, and thus the time at which the data signal input by the flip-flop 700 is level-flip cannot be simultaneously within the time window of the first clock signal and the time window of the second clock signal. That is, the first latch 701 and the second latch 702 are unlikely to be metastable at the same time, and the switching unit 704 is selectively outputting the output signal of the first latch 701 and the output of the second latch 702. When the signal is selected, it is possible to select a stable signal and output it. Therefore, in the case where the preset time is set as above, the probability that the flip-flop 700 exhibits a metastable state can be further reduced.
- the preset time is smaller than the signal period of the first clock signal, that is, the delay of the second clock signal compared to the first clock signal can be made smaller (less than the signal period of the first clock signal). That is, when the second latch 702 is metastable and the switching unit 705 selects the output signal of the first latch 701, the output signal of the first latch 701 is compared with that of the second latch 702.
- the delay time of the output signal is small, such that the output signal delay time of the entire flip-flop 700 is small, which is less than the signal period of the first clock signal. Therefore, with this arrangement, the delay time of the output signal can be reduced as compared with the scheme shown in FIG.
- the trigger 700 may be further stabilized.
- the probability of a state phenomenon may also be smaller than the sum of the setup time and the hold time of the first clock signal. Under this setting, the probability of the metastable phenomenon of the flip-flop 700 may also be reduced. There are two reasons for this:
- the value of the time window (sum of settling time and hold time) of the first clock signal and the time window of the second clock signal (sum of settling time and hold time) is usually small.
- the preset time is smaller than the time window of the first clock signal, if the time at which the data signal is level-inverted is just in the time window of the first clock signal, the time may not be in the time window of the second clock signal. That is, when the meta-stabilization phenomenon occurs in the second latch 702 employing the first clock signal, the first latch 701 employing the second clock signal may not have a metastable state. That is to say, in the case that the preset time is smaller than the time window of the first clock signal, the trigger 700 provided by the embodiment of the present application also reduces the probability of the metastable phenomenon of the trigger.
- the occurrence of the metastable phenomenon is a probability event. If the time at which the data signal is level-inverted is within the time window of the first clock signal, the second latch 702 may have a metastable state, but Metastable phenomena do not necessarily occur. Similarly, if the time at which the data signal is level-inverted is within the time window of the second clock signal, the first latch 701 may have a metastable state, but metastable state does not necessarily occur.
- the first latch In the case that the preset time is smaller than the time window of the first clock signal, even if the time at which the data signal is level-inverted is within the time window of the first clock signal and within the time window of the second clock signal, the first latch The probability that the metastable phenomenon occurs simultaneously with the second latch 702 and the second latch 702 is also less than the probability that a metastable phenomenon occurs when only the first latch 701 or the second latch 702 is set in the flip-flop. That is, since the first latch 701 and the second latch 702 that can switch the selection are provided in the flip-flop 700 provided by the embodiment of the present application, the preset time is smaller than the time window of the first clock signal. The probability of a metastable state of the flip-flop 700 is also reduced.
- the detection unit 704 is configured to detect whether the first latch 701 or the second latch 702 is in a metastable state. Specifically, when the detecting unit 704 detects whether the first latch 701 or the second latch 702 is in metastability, there are two specific implementations. The following two implementations are introduced separately.
- the detecting unit 704 when detecting whether the first latch 701 or the second latch 702 is in metastability, can be implemented as follows: the detecting unit 702 detects the first latch 701 or Whether the detected node in the second latch 702 is in metastability.
- the detection node may be any one of the first latches 701 or any of the second latches 702. If the detecting node is a node in the first latch 701, the detecting unit 704 is configured to detect whether the first latch 701 is in metastable state; if the detecting node is a node in the second latch 702, the detecting unit 704 is used to detect whether the second latch 702 is in metastable state.
- the detecting unit 704 detects whether one of the first latch 701 and the second latch 702 is in a metastable state.
- the control signal also only indicates if a particular latch is in a metastable state.
- the switching unit 705 when the switching unit 705 selects to output the output signal of the first latch 701 or the output signal of the second latch 702, the switching unit 705 may select: the currently detected latch is in a metastable state. The output signal of the other latch is selected to be output; the output signal of the currently detected latch is selected to be output when the currently detected latch is not metastable.
- the switching unit 705 selects the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal
- the switching unit 705 can be specifically implemented as follows:
- the switching unit 705 selects and outputs the second latch 702 when the detecting unit 704 detects that the first latch 701 is meta-stable.
- the output signal; the switching unit 705 selects and outputs the output signal of the first latch 701 when the detecting unit 704 detects that the first latch 701 is not in the metastable state.
- the switching unit 705 selects and outputs the first latch 701 when the detecting unit 704 detects that the second latch 702 is metastable.
- the output signal; the switching unit 705 selects to output the output signal of the second latch 702 when the detecting unit 704 detects that the second latch 702 is not in metastability.
- any one of the first latch 701 and the second latch 702 can be used as a master latch and the other latch as a secondary latch.
- the switching unit 705 temporarily selects the output signal of the secondary latch; once the master latch returns to steady state, the switching unit 705 selects the output signal of the master latch for output.
- the detecting unit 704 may include a first inverter, a second inverter, and a first exclusive OR gate circuit. among them,
- the first inverter is connected to the detecting node for outputting a low level when the voltage of the detecting node is greater than or equal to the first threshold, and outputting a high level when the voltage of the detecting node is lower than the first threshold.
- a second inverter connected to the detecting node, configured to output a low level when the voltage of the detecting node is greater than or equal to the second threshold, and output a high level when the voltage of the detecting node is lower than the second threshold, the second threshold Less than the first threshold.
- a first XOR gate circuit coupled to the first inverter and the second inverter for performing an exclusive OR operation on an output signal of the first inverter and an output signal of the second inverter, and The result of the operation is output to the switching unit 705 as a control signal.
- the detection node can be any of the first latches 701 or any of the second latches 702.
- the detection node is in metastable state, that is, the latch representing the detection node is in a metastable state.
- the structure of the flip-flop 700 can be as shown in FIG.
- the detecting unit 704 works as follows:
- the detection node When the detection node is in metastability, the detection node will be in an intermediate level state between logic 0 and logic 1. Since the first threshold of the first inverter is greater than the second threshold of the second inverter, when the level state of the detecting node changes to a value range smaller than the first threshold and greater than the second threshold, the first inverter The output is high, the second inverter outputs a low level, and the first XOR gate outputs a high level.
- the detection node When the detection node is not in metastability, the detection node is stable at a high level or a low level. If the detecting node is stable at a high level, the first inverter and the second inverter both output a low level, and the first XOR gate circuit outputs a low level; if the detecting node is stable at a low level, the first Both the inverter and the second inverter output a high level, and the first XOR gate outputs a low level.
- the level state of the control signal outputted by the detecting unit 704 can indicate whether the first latch 701 is in a metastable state, so that the switching unit 705 can selectively output under the control of the control signal output by the detecting unit 704.
- the switching unit 705 may determine that the first latch 701 is in a metastable state, and at this time, the switching unit may select to output the second latch 702. Outputting a signal to avoid transferring the metastable state to the third latch 706 of the next stage; if the control signal outputted by the detecting unit 704 to the switching unit 705 is a low level, the switching unit 705 may determine the first latch 701 Not in the metastable state, the switching unit 705 can select to output the output signal of the first latch 701.
- the detecting unit 704 is not limited to the above structure.
- the first inverter and the second inverter can also be implemented by two voltage comparators having different threshold values.
- the first XOR gate circuit can also be implemented by the same OR gate circuit.
- the switching unit 705 determines whether to output the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal outputted by the detecting unit 704, and adopts an exclusive OR gate circuit. The judgment logic at the time of implementation is reversed, and the specific implementation manner will not be described here.
- the first latch 701 when the detecting node is a node in the first latch 701, the first latch 701 may have two structural components.
- the first latch 701 may include a first clocked inverter, a second clocked inverter, and a third inverter.
- the input end of the first clocked inverter inputs a data signal
- the output end of the first clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the third inverter
- the signal outputted from the output of the phase comparator serves as the output signal of the first latch 701
- the input of the second clocked inverter is connected to the output of the third inverter, and the output of the second clocked inverter Connected to the output of the first clocked inverter.
- the first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
- the structure of the flip-flop 700 can be as shown in FIG.
- the first clocked inverter and the second clocked inverter are alternately turned on, and can be set by: the first clocked inverter triggers conduction on the rising edge of the second clock signal, and the second clock is controlled The inverter triggers the conduction on the falling edge of the second clock signal; or the first clocked inverter triggers the conduction on the falling edge of the second clock signal, and the second clocked inverter rises in the second clock signal The edge is turned on.
- the switching unit 705 selects and outputs the output signal of the second latch 702.
- the first latch 701 eventually randomly stabilizes at logic 0 or logic 1, and at this time, the detecting unit 704 detects that the first latch 701 is not in metastable state. Then, the switching unit 705 selects and outputs the output signal of the first latch 701 according to the control signal output by the detecting unit 704.
- the second latch 702 outputs a signal to the third latch 706 instead of the first latch 701 when the first latch 701 is in the metastable state, when the first latch 701 returns to the steady state. Then the second latch 702 does not function.
- the first latch 701 includes a first clocked inverter, a second clocked inverter, and a third inverter; wherein the input end of the first clocked inverter inputs a data signal, and the first clocked reverse
- the output end of the phase detector is connected as a detecting node to the detecting unit 704 and is connected to the input end of the third inverter; the signal outputted from the output end of the third inverter is used as an output signal of the first latch 701;
- the input end of the clocked inverter is connected as the feedback end of the first latch 701 to the output of the switching unit 705, and the output of the second clocked inverter is connected to the output of the first clocked inverter. Furthermore, the first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
- the structure of the flip-flop 700 can be as shown in FIG.
- the first clocked inverter and the second clocked inverter are alternately turned on, and can be set by: the first clocked inverter triggers conduction on the rising edge of the second clock signal, and the second clock is controlled The inverter triggers the conduction on the falling edge of the second clock signal; or the first clocked inverter triggers the conduction on the falling edge of the second clock signal, and the second clocked inverter rises in the second clock signal The edge is turned on.
- the switching unit 705 selects and outputs the output signal of the second latch 702. At this time, the switching unit 705 outputs a stable signal. Since the output end of the switching unit 705 is connected to the feedback end of the first latch 701 (ie, the input end of the second clocked inverter), and the output end of the second clocked inverter is connected to the detecting node, The second clocked inverter can feed back the stable level of the output of the switching unit 705 to the detecting node, thereby eliminating the metastability of the detecting node.
- the detecting unit 704 detects that the detecting node is not in metastability (ie, the first latch 701 is not in metastable state), so that the control switching unit 705 selects and outputs the output signal of the first latch 701.
- the switching unit 705 can select to output the output signal of the first latch 701 after the metastable cancellation.
- the structure of the first latch 701 in the case where the detecting unit 704 detects whether the first latch 701 is meta-stable.
- the structure of the second latch 702 can refer to the structure of the first latch 701 in FIG. 9, and details are not described herein again.
- the second latch 702 may have two structural components.
- the second latch 702 includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter.
- the input end of the third clocked inverter inputs a data signal
- the output end of the third clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the fourth inverter
- the signal outputted from the output of the phase comparator serves as the output signal of the second latch 702
- the input of the fourth clocked inverter is connected to the output of the fourth inverter, and the output of the fourth clocked inverter Connected to the output of the third clocked inverter.
- the third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
- the structure of the flip-flop 700 can be as shown in FIG.
- the third clocked inverter and the fourth clocked inverter are alternately turned on, and can be set as follows: the third clocked inverter triggers conduction on the rising edge of the first clock signal, and the fourth clock control The inverter triggers the conduction on the falling edge of the first clock signal; or the third clocked inverter triggers the conduction on the falling edge of the first clock signal, and the fourth clocked inverter rises in the first clock signal The edge is turned on.
- the switching unit 705 selects and outputs the output signal of the first latch 701.
- the detecting unit 704 detects that the second latch 702 is not in the metastable state. Then, the switching unit 705 selects and outputs the output signal of the second latch 702 according to the control signal output by the detecting unit 704.
- the first latch 701 outputs a signal to the third latch 706 instead of the second latch 702 when the second latch 702 is in metastability, when the second latch 702 returns to steady state. Then the first latch 701 does not function.
- the second latch 702 includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter.
- the input end of the third clocked inverter inputs a data signal
- the output end of the third clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the fourth inverter
- the signal outputted from the output of the phase converter is used as the output signal of the second latch 702
- the input end of the fourth clocked inverter is connected as the feedback end of the second latch 702 to the output of the switching unit 705, fourth
- the output of the clocked inverter is connected to the output of the third clocked inverter.
- the third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
- the structure of the flip-flop 700 can be as shown in FIG.
- the third clocked inverter and the fourth clocked inverter are alternately turned on, and can be set as follows: the third clocked inverter triggers conduction on the rising edge of the first clock signal, and the fourth clock control The inverter triggers the conduction on the falling edge of the first clock signal; or the third clocked inverter triggers the conduction on the falling edge of the first clock signal, and the fourth clocked inverter rises in the first clock signal The edge is turned on.
- the switching unit 705 selects and outputs the output signal of the first latch 701. At this time, the switching unit 705 outputs a stable signal. Since the output end of the switching unit 705 is connected to the feedback end of the second latch 702 (ie, the input end of the fourth clocked inverter), and the output end of the fourth clocked inverter is connected to the detecting node, The four-clocked inverter can feed back the stable level of the output of the switching unit 705 to the detecting node, thereby eliminating the metastability of the detecting node.
- the detecting unit 704 detects that the detecting node is not in metastability (ie, the second latch 702 is not in metastable state), so that the control switching unit 705 selects and outputs the output signal of the second latch 702.
- the switching unit 705 can select to output the output signal of the second latch 702 after the metastable cancellation.
- the structure of the first latch 701 can refer to the structure of the second latch 702 in FIG. 11 , and details are not described herein again.
- the detecting unit 704 detects whether the first latch 701 or the second latch 702 is metastable.
- the second implementation is described below.
- the detecting unit when detecting whether the first latch or the second latch is in a metastable state, the detecting unit may be implemented by: detecting, by the detecting unit, the first detecting node in the first latch Whether it is in metastability and detecting whether the second detection node in the second latch is in metastable state.
- the detecting unit 704 detects whether the first latch 701 and the second latch 702 are in a metastable state.
- the control signal indicates whether the first latch 701 is in a metastable state and whether the second latch 702 is in a metastable state.
- the switching unit 705 when the switching unit 705 selects the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal, the switching unit 705 can be specifically implemented as follows: the switching unit 705 is detecting When unit 704 detects that first latch 701 is in metastability, it selects to output an output signal of second latch 702. Thereafter, the switching unit 705 selects and outputs the output signal of the second latch 702 until the detecting unit 704 detects that the second latch 702 is in metastability, and the switching unit 705 selects to output the output signal of the first latch 701. . Thereafter, the switching unit 705 always selects the output signal of the first latch 701 until the detecting unit 704 detects that the first latch 701 is metastable, and the switching unit 705 selects the output signal of the second latch 702. .
- the switching unit 705 determines only the state of the latch corresponding to the current output signal when the output signal is selected. That is, when the latch corresponding to the current output signal is in a steady state, the switching unit 705 selects to output the current output signal regardless of the state of the other latch; only the latch corresponding to the current output signal is in the sub-state At steady state, the switching unit 705 selects to output the output signal of the other latch.
- the switching unit 705 is selectively outputting the output signal of the first latch 701 or the second latch.
- the output signal of 702 is reduced, the number of times of switching signals is reduced.
- the detecting unit 704 may include a first detecting circuit and a second detecting circuit; the first detecting circuit is configured to detect whether the first detecting node is in metastable state, and based on the detection result to the switching unit 705 is configured to send a first control signal, where the second detecting circuit is configured to detect whether the second detecting node is in a metastable state, and send a second control signal to the switching unit 705 according to the detection result; wherein the control signal includes the first control signal and the second control signal.
- the first detecting node may be any one of the first latches 701, and the second detecting node may be any one of the second latches 702.
- the first control signal is used to indicate whether the first latch 701 is in a metastable state
- the second control signal is used to indicate whether the second latch 702 is in a metastable state.
- the structure of the flip-flop 700 can be as shown in FIG.
- the first detecting circuit may include: a first inverter connected to the first detecting node, configured to output a low level when the voltage of the first detecting node is greater than or equal to the first threshold, and at the first detecting node And outputting a high level when the voltage is lower than the first threshold;
- the second inverter is connected to the first detecting node, and is configured to output a low level when the voltage of the first detecting node is greater than or equal to the second threshold, and at the first When the voltage of the detecting node is lower than the second threshold, the high level is output, and the second threshold is smaller than the first threshold;
- the first XOR gate circuit is connected to the first inverter and the second inverter for the first The output signal of the phase converter and the output signal of the second inverter are XORed, and the result of the exclusive OR operation is output as a first control signal to the switching unit.
- the second detecting circuit may include: a third inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the third threshold, and at the second detecting node Outputting a high level when the voltage is lower than the third threshold; and a fourth inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the fourth threshold, and in the second When the voltage of the detecting node is lower than the fourth threshold, the high level is output, and the fourth threshold is smaller than the third threshold; the second exclusive OR circuit is connected with the third inverter and the fourth inverter for the third reverse The output signal of the phase converter and the output signal of the fourth inverter are XORed, and the result of the exclusive OR operation is output as a second control signal to the switching unit.
- the working principle of the detecting unit 704 is as follows:
- the first detecting node If the first detecting node is in a metastable state, when the level state of the first detecting node changes to a value range smaller than the first threshold and greater than the second threshold, the first inverter outputs a high level, and the second inverting The device outputs a low level, and the first XOR gate outputs a high level.
- the first detecting node When the first detecting node is not in the metastable state, the first detecting node is stable at a high level or a low level, and the first XOR gate circuit outputs a low level.
- the third inverter outputs a high level
- the fourth inverting The device outputs a low level
- the second XOR gate outputs a high level.
- the first control signal outputted by the detecting unit 704 can be used to indicate whether the first latch 701 is in metastable state, and the second control signal outputted by the detecting unit 704 can indicate whether the second latch 702 is in metastable state.
- the switching unit 705 can selectively output the output signal of the first latch 701 or the output signal of the second latch 702 under the control of the first control signal and the second control signal output by the detecting unit 704.
- the switching unit may select to output an output signal of the second latch 702. Avoid transferring the metastable state to the third latch 706 of the next stage; after that, the switching unit always selects and outputs the output signal of the second latch 702 until the second control signal goes high, at this time, The second latch 702 is in a metastable state, and the switching unit selects to output the output signal of the first latch 701.
- the above description of the structure of the detecting unit 704 is merely an example.
- the detecting unit 704 is not limited to the above structure.
- the first inverter and the second inverter can also be implemented by two voltage comparators having different threshold values.
- the first XOR gate circuit can also be implemented by the same OR gate circuit.
- the switching unit 705 determines the output signal of the first latch 701 or the output signal of the second latch 702, which is opposite to the judgment logic when the XOR gate circuit is implemented. Implementations are not described here.
- the structure of the first latch 701 and the structure of the second latch 702 can refer to related descriptions in the first implementation manner, and details are not described herein again.
- the flip-flop 700 since the second clock signal used by the first latch 701 and the first clock signal used by the second latch 702 have a phase difference, then The time at which the data signal input to the flip-flop 700 is level-inverted is normally not in the second clock signal if it is within the time window of the first clock signal (ie, the second latch 702 is metastable). Within the time window (ie, the first latch 701 is not in metastability). Similarly, the time at which the data signal input in the flip-flop 700 is level-inverted is normally not in the first time if it is within the time window of the second clock signal (ie, the first latch 701 is in metastable state). Within the time window of the clock signal (ie, the second latch 702 is not in metastable state). Therefore, the first latch 701 and the second latch 702 are not simultaneously metastable.
- the switching unit 705 when the detecting unit 704 detects that the first latch 701 is meta-stable, the switching unit 705 can select the output signal of the second latch 702 according to the control signal; the detecting unit 704 detects the first When the two latches 702 are in metastability, the switching unit 705 can select to output an output signal of the first latch 701 according to the control signal. Therefore, with the flip-flop 700 provided by the embodiment of the present application, the signal output to the input end of the third latch 706 can be in a stable state, so that the output signal of the flip-flop 700 is in a stable state, and the trigger 700 is reduced. The probability of steady state phenomenon, thus avoiding the logic misjudgment of the output signal of the trigger and affecting the normal operation of the system.
- the output signal of the flip-flop 700 can be stabilized by the structure inside the flip-flop 700, and the delay of the system output caused by the scheme of eliminating the metastable state by using the flip-flop cascade manner is avoided. , improved system performance.
- the trigger 700 provided by the embodiment of the present application is used in multiple systems, the output delay of each system can be reduced, thereby improving the performance of multi-system interaction.
- the flip-flop includes a master latch, a sub-latch L, a delay unit, and a latch H.
- the clock signal used by the master latch is a clock signal obtained by delaying the delay unit, and the clock signal used by the slave latch is an undelayed clock signal clk.
- the master latch in addition to two clocked inverters for implementing data latching and an inverter (two clocked inverters and one inverter can form the first of the flip-flops 700)
- a high threshold inverter, a low threshold inverter, an exclusive OR gate circuit, and a data selector are included. The inputs of the high threshold inverter and the low threshold inverter are both connected to point A.
- a combination of a high threshold inverter, a low threshold inverter, and an exclusive OR gate circuit can be regarded as one specific example of the detecting unit 704 in the flip flop 700; the data selector can be regarded as the switching unit 705 in the flip flop 700 A specific example of this; the latch H can be considered as a specific example of the third latch 706 in the flip-flop 700.
- the trigger shown in Figure 14 works as follows:
- the high threshold inverter determines that point A is low when the intermediate level state of point A is collected, so the high threshold inverter inverts the low level and outputs a high level; the low threshold inverter collects the A When the middle level state of the point is judged, the point A is high, so the low threshold inverter inverts the high level and outputs the low level.
- the XOR gate circuit outputs a high level after XORing the high level of the high threshold inverter output and the low level of the low threshold inverter output.
- the data selector After receiving the high level of the XOR gate output, the data selector switches the output signal to the sub-latch, that is, outputs the output signal of the sub-latch to the latch H. Since the master latch and the sub-latch use different clock signals, point A is in metastable state, point B is not metastable, therefore, the data selector outputs a signal to latch H (sub latch) The output signal of the device is a stable signal.
- the level state of point C is fed back to point A through a clocked inverter. Since point C is in a steady state, the level state of point C is fed back to point A, which causes point A to change from metastable to steady state.
- the outputs of the high threshold inverter and the low threshold inverter are identical (that is, both are high level, or both are low level), and the XOR gate circuit outputs a low level.
- the data selector switches the output signal to the master latch, that is, outputs the output signal of the master latch to the latch H.
- the sub-latch temporarily outputs a signal to the latch H instead of the master latch when the master latch is in metastability, and selects the output master latch after the meta-stable of the master latch is removed. Output signal of the device.
- the trigger shown in FIG. 14 can be regarded as a specific example of the trigger 700 shown in FIG. 7.
- the implementation manner not described in detail in the trigger shown in FIG. 14 can be seen in the trigger shown in FIG. A related description in the device 700.
- the embodiment of the present application provides a trigger.
- the probability of a metastable phenomenon of the trigger can be reduced, and the output signal of the trigger can be prevented from being logically misjudged and affecting the normal operation of the system.
- the switching unit, the detecting unit, the delay unit, and the latch are presented in a modular manner, which is a functional division manner, but in actual products, these are Two or more of the modules may be integrated into one module, and the protection scope of the embodiment of the present application should not be limited by the division manner.
- the flip-flop provided by the embodiment of the invention can be used in an integrated circuit of various devices, in particular, an interaction circuit between high and low frequency modules, such as an interface circuit of a CPU core and a peripheral device.
- an interaction circuit between high and low frequency modules such as an interface circuit of a CPU core and a peripheral device.
- the flip-flop provided by the embodiment of the present invention can reduce the probability of occurrence of metastability, it can also be widely applied as a basic device to other integrated circuit solutions.
Landscapes
- Logic Circuits (AREA)
Abstract
A flip-flop (700) and an integrated circuit, wherein same are used to reduce the probability of the occurrence of the phenomenon of metastability of a flip-flop. The flip-flop (700) comprises: a first latch (701), a second latch (702), a delay unit (703), a detection unit (704), a switching unit (705) and a third latch (706), wherein the delay unit (703) is used to delay a first clock signal and then output a second clock signal; the first latch (701) is used to latch or output a data signal according to the second clock signal; the latch (702) is used to latch or output the data signal according to the first clock signal; the detection unit (704) is used to detect whether the first latch (701) or the second latch (702) is in a metastable state, and output a control signal to the switching unit (705) based on a detection result; the switching unit (705) is used to choose, according to the control signal, to output an output signal of the first latch (701) or an output signal of the second latch (702); and the third latch (706) is used to latch or output an output signal of the switching unit (705).
Description
本申请要求于2018年3月27日提交中国专利局、申请号为201810260366.0、申请名称为“一种触发器及集成电路”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201, 810, 026, 036, filed on March 27, 2018, the entire disclosure of which is hereby incorporated by reference. .
本申请涉及电子技术领域,尤其涉及一种触发器及集成电路。The present application relates to the field of electronic technologies, and in particular, to a flip-flop and an integrated circuit.
触发器是一种具有记忆功能的信息存储器件,是构成多种时序电路的基本逻辑单元。A flip-flop is an information storage device with a memory function and is a basic logic unit constituting a plurality of sequential circuits.
图1示出了一种D触发器(D type flip-flop,DFF)。其中,din表示输入的数据信号,clk表示输入的时钟信号,dout表示输出信号,rst表示复位信号。图1所示的D触发器为一种上升沿触发的D触发器,时钟信号的上升沿会触发该D触发器锁存输入信号的电平状态,然后通过Q管脚输出锁存的电平。Figure 1 shows a D type flip-flop (DFF). Where din represents the input data signal, clk represents the input clock signal, dout represents the output signal, and rst represents the reset signal. The D flip-flop shown in Figure 1 is a rising edge triggered D flip-flop. The rising edge of the clock signal triggers the level state of the D flip-flop latch input signal and then outputs the latched level through the Q pin. .
现有技术中,针对图1所示的D触发器,在时钟信号的上升沿附近定义了一个时间窗口,原则上规定,在该时间窗口内输入的数据信号din不应发生电平翻转。若在该时间窗口上din发生了电平翻转,可能会导致D触发器内的某些节点无法稳定在逻辑0或逻辑1的电平状态,从而导致输出信号dout在该时钟信号的上升沿之后的一段时间内处于不确定的状态,即亚稳态。其中,输出信号dout处于不确定状态的这段时间称为决断时间(resolution time)。经过决断时间之后,输出信号dout会随机地稳定在0或1上。In the prior art, for the D flip-flop shown in FIG. 1, a time window is defined near the rising edge of the clock signal, and in principle, the data signal din input in the time window should not be level-inverted. If the level flip occurs in the din window during this time window, some nodes in the D flip-flop may not be stable in the logic 0 or logic 1 level state, resulting in the output signal dout after the rising edge of the clock signal. It is in an indeterminate state for a period of time, that is, metastable state. The time during which the output signal dout is in an indeterminate state is referred to as a resolution time. After the decision time, the output signal dot will be randomly stabilized at 0 or 1.
示例性地,如图2所示,为一种D触发器的输入输出信号的时序图。其中,输入的数据信号din在定义的时间窗口内发生电平翻转,输出信号dout在一段时间(Tmet)内徘徊在逻辑0和逻辑1之间的中间电平状态,最终稳定在逻辑1上。Illustratively, as shown in FIG. 2, it is a timing diagram of input and output signals of a D flip-flop. Wherein, the input data signal din is level-inverted within a defined time window, and the output signal dout is in an intermediate level state between logic 0 and logic 1 for a period of time (Tmet), and finally stabilizes at logic 1.
当D触发器出现亚稳态现象后,由于输出信号最终随机地稳定在逻辑0或逻辑1上,因而会造成输出信号的逻辑误判。此外,输出信号在决断时间内的不确定状态还会导致下一级电路产生亚稳态,影响整个系统的正常工作。When the D flip-flop appears metastable state, the output signal is finally randomly stabilized at logic 0 or logic 1, which causes a logical misjudgment of the output signal. In addition, the indeterminate state of the output signal during the decision time will also cause the next-stage circuit to produce metastable state, which affects the normal operation of the entire system.
因此,现有技术提供的触发器会出现亚稳态现象,从而导致逻辑误判、系统无法正常工作的问题。Therefore, the trigger provided by the prior art may exhibit a metastable state, which leads to a logic misjudgment and a problem that the system cannot work normally.
发明内容Summary of the invention
本申请实施例提供一种触发器及集成电路,用以减小触发器出现亚稳态现象的概率,避免触发器的输出信号出现逻辑误判、影响系统正常工作。The embodiment of the present application provides a flip-flop and an integrated circuit for reducing the probability of a metastable phenomenon of a trigger, preventing a logical misjudgment of the output signal of the trigger, and affecting normal operation of the system.
第一方面,本申请实施例提供一种触发器,用于在第一时钟信号的控制下对输入的数据信号进行锁存和输出,该触发器包括包括:第一锁存器、第二锁存器、延迟单元、检测单元、切换单元以及第三锁存器。其中,In a first aspect, an embodiment of the present application provides a trigger for latching and outputting an input data signal under control of a first clock signal, the trigger including: a first latch, a second lock a buffer, a delay unit, a detection unit, a switching unit, and a third latch. among them,
延迟单元,用于将第一时钟信号延迟预设时间后得到并输出第二时钟信号。And a delay unit, configured to delay and output the second clock signal after delaying the first clock signal by a preset time.
第一锁存器的时钟信号输入端与延迟单元连接,以接收第二时钟信号;第一锁存器用于根据第二时钟信号,对数据信号进行锁存或输出。The clock signal input end of the first latch is coupled to the delay unit to receive the second clock signal; the first latch is configured to latch or output the data signal according to the second clock signal.
第二锁存器用于根据第一时钟信号,对数据信号进行锁存或输出。The second latch is configured to latch or output the data signal according to the first clock signal.
检测单元用于检测第一锁存器或第二锁存器是否处于亚稳态,并基于检测结果向切换单元发送控制信号。The detecting unit is configured to detect whether the first latch or the second latch is in a metastable state, and send a control signal to the switching unit based on the detection result.
切换单元用于根据控制信号,选择输出第一锁存器的输出信号或第二锁存器的输出信号。The switching unit is configured to select an output signal of the first latch or an output signal of the second latch according to the control signal.
第三锁存器的数据输入端与切换单元的输出端连接,用于根据第一时钟信号,对切换单元的输出信号进行锁存或输出。The data input end of the third latch is connected to the output end of the switching unit for latching or outputting the output signal of the switching unit according to the first clock signal.
其中,切换单元可通过具有两路输入信号的数据选择器实现。The switching unit can be implemented by a data selector having two input signals.
采用上述方案,由于第一锁存器所采用的第二时钟信号和第二锁存器所采用的第一时钟信号存在相位差,那么,在触发器中输入的数据信号发生电平翻转的时刻,若正处于第一时钟信号的时间窗口内(即第二锁存器处于亚稳态),则通常不会处于第二时钟信号的时间窗口内(即第一锁存器不处于亚稳态)。同样地,触发器中输入的数据信号发生电平翻转的时刻,若正处于第二时钟信号的时间窗口内(即第一锁存器处于亚稳态),则通常不会处于第一时钟信号的时间窗口内(即第二锁存器不处于亚稳态)。因此,第一锁存器和第二锁存器不会同时处于亚稳态。In the above solution, since there is a phase difference between the second clock signal used by the first latch and the first clock signal used by the second latch, the time at which the data signal input in the flip-flop is level-reversed If it is in the time window of the first clock signal (ie, the second latch is in metastable state), it is usually not in the time window of the second clock signal (ie, the first latch is not in metastable state) ). Similarly, when the data signal input in the flip-flop is level-inverted, if it is in the time window of the second clock signal (ie, the first latch is in metastable state), it is usually not in the first clock signal. Within the time window (ie the second latch is not in metastable state). Therefore, the first latch and the second latch are not simultaneously metastable.
在第一方面提供的触发器中,在检测单元检测到第一锁存器处于亚稳态时,则切换单元可根据控制信号选择输出第二锁存器的输出信号;在检测单元检测到第二锁存器处于亚稳态时,则切换单元可根据控制信号选择输出第一锁存器的输出信号。因此,采用第一方面提供的触发器,可以使得输出至第三锁存器的输入端的信号处于稳定状态,从而使得触发器的输出信号处于稳定状态,减小触发器出现亚稳态现象的概率,从而避免触发器的输出信号出现逻辑误判、影响系统正常工作。In the flip-flop provided in the first aspect, when the detecting unit detects that the first latch is in a metastable state, the switching unit may select to output an output signal of the second latch according to the control signal; When the two latches are in metastability, the switching unit can select to output an output signal of the first latch according to the control signal. Therefore, by using the flip-flop provided by the first aspect, the signal output to the input end of the third latch can be in a stable state, so that the output signal of the flip-flop is in a stable state, and the probability of a metastable phenomenon of the flip-flop is reduced. In order to avoid the logic output of the trigger output signal, affecting the normal operation of the system.
其中,预设时间可以设置如下:预设时间大于第一锁存器的建立时间和保持时间之和,且小于第一时钟信号的信号周期。The preset time may be set as follows: the preset time is greater than a sum of a setup time and a hold time of the first latch, and is smaller than a signal period of the first clock signal.
在预设时间采用如上设置的情况下,由于第一时钟信号和第二时钟信号的相位差大于第一时钟信号的时间窗口(即建立时间和保持时间之和)、且小于第一时钟信号的信号周期的一半,因而触发器输入的数据信号发生电平翻转的时刻不可能同时处于第一时钟信号的时间窗口和第二时钟信号的时间窗口内。也就是说,第一锁存器和第二锁存器不可能同时处于亚稳态,那么切换单元在选择输出第一锁存器的输出信号和第二锁存器的输出信号时,一定可以选择到一个稳定信号并输出。因此,在预设时间采用如上设置的情况下,可以进一步减小触发器出现亚稳态现象的概率。In the case where the preset time is set as above, since the phase difference between the first clock signal and the second clock signal is greater than the time window of the first clock signal (ie, the sum of the setup time and the hold time), and is smaller than the first clock signal Half of the signal period, and thus the time at which the data signal input by the flip-flop is level-flip cannot be simultaneously within the time window of the first clock signal and the time window of the second clock signal. That is to say, the first latch and the second latch are not simultaneously metastable, and the switching unit can certainly select when outputting the output signal of the first latch and the output signal of the second latch. Select a stable signal and output. Therefore, in the case where the preset time is set as above, the probability that the trigger exhibits a metastable state can be further reduced.
此外,预设时间小于第一时钟信号的信号周期,可以使得第二时钟信号相较于第一时钟信号的延迟较小(小于第一时钟信号的信号周期)。也就是说,在第二锁存器发生亚稳态、切换单元选择第一锁存器的输出信号时,第一锁存器的输出信号相较于第二锁存器的输出信号的延迟时间较小,从而使得整个触发器的输出信号延迟时间较小,该延迟时间小于第一时钟信号的信号周期。In addition, the preset time is shorter than the signal period of the first clock signal, so that the delay of the second clock signal compared to the first clock signal can be made smaller (less than the signal period of the first clock signal). That is, when the second latch generates a metastable state and the switching unit selects the output signal of the first latch, the delay time of the output signal of the first latch compared to the output signal of the second latch Smaller, so that the output signal delay time of the entire flip-flop is smaller, and the delay time is smaller than the signal period of the first clock signal.
在一种可能的设计中,切换单元在根据控制信号,选择输出第一锁存器的输出信号或第二锁存器的输出信号时,可通过如下方式实现:切换单元在检测单元确定第一锁存器处于亚稳态时,选择输出第二锁存器的输出信号;或者,切换单元在检测单元确定第二锁存器处于亚稳态时,选择输出第一锁存器的输出信号。In a possible design, when the switching unit selectively outputs the output signal of the first latch or the output signal of the second latch according to the control signal, the switching unit may be implemented as follows: the switching unit determines the first in the detecting unit When the latch is in metastable state, the output signal of the second latch is selected to be output; or, the switching unit selects to output the output signal of the first latch when the detecting unit determines that the second latch is in metastability.
采用上述方案,可以使得切换单元输出至第三锁存器的输入端的信号处于稳定状态, 从而使得触发器的输出信号处于稳定状态,减小触发器出现亚稳态现象的概率。With the above solution, the signal output from the switching unit to the input end of the third latch can be in a stable state, so that the output signal of the flip-flop is in a stable state, and the probability of the metastable phenomenon of the flip-flop is reduced.
如前所述,检测单元用于检测第一锁存器或第二锁存器是否处于亚稳态。具体地,检测单元在检测第一锁存器或第二锁存器是否处于亚稳态时,可以有两种具体实现方式。下面分别对这两种实现方式进行介绍。As previously mentioned, the detection unit is operative to detect if the first or second latch is in a metastable state. Specifically, the detecting unit can have two specific implementations when detecting whether the first latch or the second latch is in a metastable state. The following two implementations are introduced separately.
第一种实现方式First implementation
在一种可能的设计中,检测单元在检测第一锁存器或第二锁存器是否处于亚稳态时,具体用于:检测单元检测第一锁存器或第二锁存器中的检测节点是否处于亚稳态。In a possible design, the detecting unit is configured to detect whether the first latch or the second latch is in a metastable state, specifically, the detecting unit detects the first latch or the second latch Check if the node is metastable.
采用第一种实现方式,检测单元检测第一锁存器和第二锁存器中的某一个锁存器是否处于亚稳态即可。控制信号也仅指示某一个锁存器是否处于亚稳态的情况。In a first implementation, the detecting unit detects whether one of the first latch and the second latch is metastable. The control signal also only indicates if a particular latch is in a metastable state.
切换单元在选择输出第一锁存器的输出信号或第二锁存器的输出信号时,可以这样选择:在当前检测的锁存器处于亚稳态时选择输出另一个锁存器的输出信号;在当前检测的锁存器不处于亚稳态时选择输出当前检测的锁存器的输出信号。When the switching unit selectively outputs the output signal of the first latch or the output signal of the second latch, the switching unit may select: outputting the output signal of the other latch when the currently detected latch is in metastability The output signal of the currently detected latch is selected to be output when the currently detected latch is not in metastability.
在一种可能的设计中,检测单元可以包括第一反相器、第二反相器和第一异或门电路。其中,In one possible design, the detecting unit may include a first inverter, a second inverter, and a first exclusive OR gate circuit. among them,
第一反相器,与检测节点连接,用于在检测节点的电压大于或等于第一阈值时输出低电平,以及在检测节点的电压低于第一阈值时输出高电平。The first inverter is connected to the detecting node for outputting a low level when the voltage of the detecting node is greater than or equal to the first threshold, and outputting a high level when the voltage of the detecting node is lower than the first threshold.
第二反相器,与检测节点连接,用于在检测节点的电压大于或等于第二阈值时输出低电平,以及在检测节点的电压低于第二阈值时输出高电平,第二阈值小于第一阈值。a second inverter connected to the detecting node, configured to output a low level when the voltage of the detecting node is greater than or equal to the second threshold, and output a high level when the voltage of the detecting node is lower than the second threshold, the second threshold Less than the first threshold.
第一异或门电路,与第一反相器和第二反相器连接,用于对第一反相器的输出信号和第二反相器的输出信号进行异或操作,并将异或操作的结果作为控制信号输出至切换单元。a first XOR gate circuit coupled to the first inverter and the second inverter for performing an exclusive OR operation on an output signal of the first inverter and an output signal of the second inverter, and The result of the operation is output as a control signal to the switching unit.
采用上述方案,当检测节点所在的锁存器处于亚稳态时,第一异或门电路输出高电平;当检测节点所在的锁存器不处于亚稳态时,第一异或门电路输出低电平。因此,检测单元输出的控制信号的电平状态即可表征检测节点所在的锁存器是否处于亚稳态,从而使得切换单元可以根据控制信号,选择性地输出第一锁存器的输出信号或第二锁存器的输出信号。With the above scheme, when the latch in which the detecting node is located is in metastable state, the first XOR gate circuit outputs a high level; when the latch in which the detecting node is located is not in metastability, the first XOR gate circuit The output is low. Therefore, the level state of the control signal output by the detecting unit can represent whether the latch in which the detecting node is located is metastable, so that the switching unit can selectively output the output signal of the first latch according to the control signal or The output signal of the second latch.
在第一方面提供的触发器中,第一锁存器的结构可以有如下两种形式:In the flip-flop provided in the first aspect, the structure of the first latch can have the following two forms:
第一种The first
第一锁存器包括第一钟控反相器、第二钟控反相器和第三反相器;第一钟控反相器的输入端输入数据信号,第一钟控反相器的输出端作为检测节点与检测单元连接,且与第三反相器的输入端连接;第三反相器的输出端输出的信号作为第一锁存器的输出信号;第二钟控反相器的输入端与第三反相器的输出端连接,第二钟控反相器的输出端与第一钟控反相器的输出端连接;其中,第一钟控反相器和第二钟控反相器在第二时钟信号下交替导通。The first latch includes a first clocked inverter, a second clocked inverter, and a third inverter; an input of the first clocked inverter inputs a data signal, and the first clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the third inverter; the signal outputted by the output end of the third inverter is used as an output signal of the first latch; the second clocked inverter The input end is connected to the output end of the third inverter, and the output end of the second clocked inverter is connected to the output end of the first clocked inverter; wherein the first clocked inverter and the second clock The control inverter is alternately turned on under the second clock signal.
当第一锁存器采用如上结构时,若第一锁存器处于亚稳态,则切换单元选择输出第二锁存器的输出信号。当第一锁存器的决断时间结束,第一锁存器最终会随机地稳定在逻辑0或逻辑1,此时,检测单元检测到第一锁存器不处于亚稳态,则切换单元会根据检测单元输出的控制信号,选择输出第一锁存器的输出信号。也就是说,第二锁存器在第一锁存器处于亚稳态时代替第一锁存器向第三锁存器输出信号,在第一锁存器恢复稳态时则第二锁存器不起作用。When the first latch adopts the above structure, if the first latch is in metastable state, the switching unit selects and outputs the output signal of the second latch. When the decision time of the first latch ends, the first latch will eventually stabilize at logic 0 or logic 1 randomly. At this time, the detecting unit detects that the first latch is not in metastable state, the switching unit will The output signal of the first latch is selected to be output according to a control signal output from the detecting unit. That is, the second latch outputs a signal to the third latch instead of the first latch when the first latch is in metastability, and the second latch when the first latch returns to steady state. The device does not work.
第二种Second
第一锁存器包括第一钟控反相器、第二钟控反相器和第三反相器;第一钟控反相器的输入端输入数据信号,第一钟控反相器的输出端作为检测节点与检测单元连接,且与第三反相器的输入端连接;第三反相器的输出端输出的信号作为第一锁存器的输出信号;第二钟控反相器的输入端作为第一锁存器的反馈端与切换单元的输出端连接,第二钟控反相器的输出端与第一钟控反相器的输出端连接;其中,第一钟控反相器和第二钟控反相器在第二时钟信号下交替导通。The first latch includes a first clocked inverter, a second clocked inverter, and a third inverter; an input of the first clocked inverter inputs a data signal, and the first clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the third inverter; the signal outputted by the output end of the third inverter is used as an output signal of the first latch; the second clocked inverter The input end is connected as the feedback end of the first latch to the output end of the switching unit, and the output end of the second clocked inverter is connected to the output end of the first clocked inverter; wherein, the first clocked reverse The phase comparator and the second clocked inverter are alternately turned on under the second clock signal.
采用上述方案,由于反馈端可以将稳定电平反馈至检测节点,因而与第一锁存器的第一种结构相比,采用第二种结构,检测节点的亚稳态可以在更短的时间内被消除,切换单元可在亚稳态消除后进行切换,选择输出第一锁存器的输出信号。With the above scheme, since the feedback terminal can feed back the stable level to the detecting node, the second structure is adopted, and the metastability of the detecting node can be detected in a shorter time than the first structure of the first latch. After being eliminated, the switching unit can switch after the metastable state is removed, and select the output signal of the output first latch.
在第一方面提供的触发器中,第二锁存器的结构可以有如下两种形式:In the flip-flop provided in the first aspect, the structure of the second latch can have the following two forms:
第一种The first
第二锁存器包括第三钟控反相器、第四钟控反相器和第四反相器;第三钟控反相器的输入端输入数据信号,第三钟控反相器的输出端作为检测节点与检测单元连接,且与第四反相器的输入端连接;第四反相器的输出端输出的信号作为第二锁存器的输出信号;第四钟控反相器的输入端与第四反相器的输出端连接,第四钟控反相器的输出端与第三钟控反相器的输出端连接;其中,第三钟控反相器和第四钟控反相器在第一时钟信号下交替导通。The second latch includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter; the input of the third clocked inverter inputs a data signal, and the third clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the fourth inverter; the signal outputted by the output end of the fourth inverter is used as an output signal of the second latch; the fourth clocked inverter The input end is connected to the output end of the fourth inverter, and the output end of the fourth clocked inverter is connected to the output end of the third clocked inverter; wherein the third clocked inverter and the fourth clock The control inverter is alternately turned on under the first clock signal.
采用上述方案,若第二锁存器处于亚稳态,则切换单元选择输出第一锁存器的输出信号。当第二锁存器的决断时间结束,第二锁存器最终会随机地稳定在逻辑0或逻辑1,此时,检测单元检测到第二锁存器不处于亚稳态,则切换单元会根据检测单元的检测结果,选择输出第二锁存器的输出信号。也就是说,第一锁存器在第二锁存器处于亚稳态时代替第二锁存器向第三锁存器输出信号,在第二锁存器恢复稳态时则第一锁存器不起作用。With the above scheme, if the second latch is in metastable state, the switching unit selects and outputs the output signal of the first latch. When the decision time of the second latch ends, the second latch will eventually stabilize at logic 0 or logic 1 randomly. At this time, the detecting unit detects that the second latch is not in metastable state, the switching unit will The output signal of the second latch is outputted according to the detection result of the detecting unit. That is, the first latch outputs a signal to the third latch instead of the second latch when the second latch is in metastability, and the first latch when the second latch returns to steady state. The device does not work.
第二种Second
第二锁存器包括第三钟控反相器、第四钟控反相器和第四反相器;第三钟控反相器的输入端输入数据信号,第三钟控反相器的输出端作为检测节点与检测单元连接,且与第四反相器的输入端连接;第四反相器的输出端输出的信号作为第二锁存器的输出信号;第四钟控反相器的输入端作为第二锁存器的反馈端与切换单元的输出端连接,第四钟控反相器的输出端与第三钟控反相器的输出端连接;其中,第三钟控反相器和第四钟控反相器在第一时钟信号下交替导通。The second latch includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter; the input of the third clocked inverter inputs a data signal, and the third clocked inverter The output end is connected as a detecting node to the detecting unit, and is connected to the input end of the fourth inverter; the signal outputted by the output end of the fourth inverter is used as an output signal of the second latch; the fourth clocked inverter The input end is connected as the feedback end of the second latch to the output end of the switching unit, and the output end of the fourth clocked inverter is connected to the output end of the third clocked inverter; wherein, the third clocked reverse The phase comparator and the fourth clocked inverter are alternately turned on under the first clock signal.
采用上述方案,由于反馈端可以将稳定电平反馈至检测节点,因而与第二锁存器的第一种结构相比,采用第二种结构,检测节点的亚稳态可以在更短的时间内被消除,切换单元可在亚稳态消除后进行切换,选择输出第二锁存器的输出信号。With the above scheme, since the feedback terminal can feed back the stable level to the detecting node, the second structure is adopted, and the metastability of the detecting node can be detected in a shorter time than the first structure of the second latch. After being eliminated, the switching unit can switch after the metastable state is removed, and select the output signal of the output second latch.
以上是对检测单元检测第一锁存器或第二锁存器是否处于亚稳态的第一种实现方式进行的介绍,下面介绍第二种实现方式。The above is an introduction to the first implementation of detecting whether the first latch or the second latch is in metastable state. The second implementation is described below.
第二种实现方式Second implementation
在一种可能的设计中,检测单元在检测第一锁存器或第二锁存器是否处于亚稳态时,具体用于:检测单元检测第一锁存器中的第一检测节点是否处于亚稳态,以及检测第二锁存器中的第二检测节点是否处于亚稳态。In a possible design, when the detecting unit detects whether the first latch or the second latch is in metastability, the detecting unit is configured to: detect whether the first detecting node in the first latch is in Metastable, and detecting whether the second detected node in the second latch is in metastable state.
采用第二种实现方式,检测单元对第一锁存器和第二锁存器是否处于亚稳态的情况均 进行检测。控制信号指示第一锁存器是否处于亚稳态的情况以及第二锁存器是否处于亚稳态的情况。With the second implementation, the detecting unit detects whether the first latch and the second latch are in a metastable state. The control signal indicates whether the first latch is in a metastable condition and whether the second latch is in a metastable state.
切换单元在选择输出第一锁存器的输出信号或第二锁存器的输出信号时,可以这样选择:在第一锁存器处于亚稳态时选择输出第二锁存器的输出信号,之后一直选择输出第二锁存器的输出信号,直至控制信号指示第二锁存器处于亚稳态时,才选择输出第一锁存器的输出信号;同样地,在第二锁存器处于亚稳态时选择输出第一锁存器的输出信号,之后一直选择输出第一锁存器的输出信号,直至控制信号指示第一锁存器处于亚稳态时,才选择输出第二锁存器的输出信号。When the switching unit selectively outputs the output signal of the first latch or the output signal of the second latch, the switching unit may select to output the output signal of the second latch when the first latch is in metastability, Afterwards, the output signal of the second latch is selected and outputted until the control signal indicates that the second latch is in metastable state, and the output signal of the first latch is selected to be output; likewise, the second latch is at In the metastable state, the output signal of the first latch is selected, and then the output signal of the first latch is selected until the control signal indicates that the first latch is in metastable state, and the second latch is selected for output. Output signal of the device.
不难看出,第二种实现方式与第一种实现方式相比,检测单元需要检测的节点增多了,但切换单元在选择输出第一锁存器的输出信号或第二锁存器的输出信号时,会减小切换信号的次数。It is not difficult to see that the second implementation manner has more nodes to be detected by the detecting unit than the first implementation manner, but the switching unit selects and outputs the output signal of the first latch or the output signal of the second latch. When it is, the number of switching signals is reduced.
在一种可能的实现方式中,上述检测单元包括第一检测电路和第二检测电路;第一检测电路用于检测第一检测节点是否处于亚稳态,并基于检测结果向切换单元发送第一控制信号;第二检测电路用于检测第二检测节点是否处于亚稳态,并基于检测结果向切换单元发送第二控制信号;其中,控制信号包含第一控制信号和第二控制信号。In a possible implementation, the detecting unit includes a first detecting circuit and a second detecting circuit. The first detecting circuit is configured to detect whether the first detecting node is in a metastable state, and send the first to the switching unit based on the detection result. a second detection circuit is configured to detect whether the second detection node is in a metastable state, and send a second control signal to the switching unit based on the detection result; wherein the control signal includes the first control signal and the second control signal.
在上述方案中,第一控制信号用于指示第一锁存器是否处于亚稳态的情况,第二控制信号用于指示第二锁存器是否处于亚稳态的情况。In the above scheme, the first control signal is used to indicate whether the first latch is in a metastable state, and the second control signal is used to indicate whether the second latch is in a metastable state.
在一种可能的实现方式中,第一检测电路包括:第一反相器,与第一检测节点连接,用于在第一检测节点的电压大于或等于第一阈值时输出低电平,以及在第一检测节点的电压低于第一阈值时输出高电平;第二反相器,与第一检测节点连接,用于在第一检测节点的电压大于或等于第二阈值时输出低电平,以及在第一检测节点的电压低于第二阈值时输出高电平,第二阈值小于第一阈值;第一异或门电路,与第一反相器和第二反相器连接,用于对第一反相器的输出信号和第二反相器的输出信号进行异或操作,并将异或操作的结果作为第一控制信号输出至切换单元;In a possible implementation, the first detecting circuit includes: a first inverter connected to the first detecting node, configured to output a low level when the voltage of the first detecting node is greater than or equal to the first threshold, and Outputting a high level when the voltage of the first detecting node is lower than the first threshold; and connecting the second inverter to the first detecting node, and outputting the low power when the voltage of the first detecting node is greater than or equal to the second threshold Leveling, and outputting a high level when the voltage of the first detecting node is lower than the second threshold, the second threshold is less than the first threshold; the first XOR gate circuit is connected to the first inverter and the second inverter, And performing an exclusive OR operation on the output signal of the first inverter and the output signal of the second inverter, and outputting the result of the exclusive OR operation as a first control signal to the switching unit;
第二检测电路包括:第三反相器,与第二检测节点连接,用于在第二检测节点的电压大于或等于第三阈值时输出低电平,以及在第二检测节点的电压低于第三阈值时输出高电平;第四反相器,与第二检测节点连接,用于在第二检测节点的电压大于或等于第四阈值时输出低电平,以及在第二检测节点的电压低于第四阈值时输出高电平,第四阈值小于第三阈值;第二异或门电路,与第三反相器和第四反相器连接,用于对第三反相器的输出信号和第四反相器的输出信号进行异或操作,并将异或操作的结果作为第二控制信号输出至切换单元。The second detecting circuit includes: a third inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the third threshold, and a voltage lower than the second detecting node a third threshold is outputting a high level; a fourth inverter is coupled to the second detecting node for outputting a low level when the voltage of the second detecting node is greater than or equal to a fourth threshold, and at the second detecting node When the voltage is lower than the fourth threshold, the high level is output, and the fourth threshold is smaller than the third threshold; the second exclusive OR circuit is connected to the third inverter and the fourth inverter, and is used for the third inverter The output signal and the output signal of the fourth inverter are XORed, and the result of the exclusive OR operation is output as a second control signal to the switching unit.
采用上述方案,由于第二阈值小于第一阈值,因而当第一锁存器处于亚稳态时,第一异或门电路输出高电平;当第一锁存器不处于亚稳态时,第一异或门电路输出低电平。因此,第一检测电路输出的第一控制信号的电平状态即可表征第一锁存器是否处于亚稳态;同样地,由于第四阈值小于第三阈值,因而当第二锁存器处于亚稳态时,第二异或门电路输出高电平;当第二锁存器不处于亚稳态时,第二异或门电路输出低电平。因此,第二检测电路输出的第二控制信号的电平状态即可表征第二锁存器是否处于亚稳态。切换单元可以根据第一控制信号和第二控制信号,选择性地输出第一锁存器的输出信号或第二锁存器的输出信号。With the above solution, since the second threshold is smaller than the first threshold, the first XOR gate circuit outputs a high level when the first latch is in a metastable state; when the first latch is not in a metastable state, The first XOR gate outputs a low level. Therefore, the level state of the first control signal output by the first detecting circuit can be used to indicate whether the first latch is in a metastable state; likewise, since the fourth threshold is less than the third threshold, when the second latch is in At metastability, the second XOR gate outputs a high level; when the second latch is not in a metastable state, the second XOR gate outputs a low level. Therefore, the level state of the second control signal output by the second detecting circuit can indicate whether the second latch is in metastable state. The switching unit may selectively output an output signal of the first latch or an output signal of the second latch according to the first control signal and the second control signal.
第二方面,本申请实施例提供一种集成电路,该集成电路包含上述第一方面及其任一 种可能的实现方式中提供的触发器。In a second aspect, an embodiment of the present application provides an integrated circuit comprising the flip-flop provided in the above first aspect and any possible implementation manner thereof.
图1为现有技术提供的一种D触发器的示意图;1 is a schematic diagram of a D flip-flop provided by the prior art;
图2为现有技术提供的一种D触发器的输入输出信号的时序图;2 is a timing diagram of input and output signals of a D flip-flop provided by the prior art;
图3为本申请实施例提供的一种D触发器的内部结构示意图;FIG. 3 is a schematic diagram of an internal structure of a D flip-flop according to an embodiment of the present disclosure;
图4为本申请实施例提供的一种触发器系统的结构示意图;4 is a schematic structural diagram of a trigger system according to an embodiment of the present application;
图5为本申请实施例提供的一种触发器系统的输入输出信号的时序图;FIG. 5 is a timing diagram of input and output signals of a trigger system according to an embodiment of the present disclosure;
图6为本申请实施例提供的另一种触发器系统的输入输出信号的时序图;6 is a timing diagram of input and output signals of another trigger system according to an embodiment of the present disclosure;
图7为本申请实施例提供的第一种触发器的结构示意图;FIG. 7 is a schematic structural diagram of a first type of trigger provided by an embodiment of the present application;
图8为本申请实施例提供的第二种触发器的结构示意图;FIG. 8 is a schematic structural diagram of a second type of trigger provided by an embodiment of the present application;
图9为本申请实施例提供的第三种触发器的结构示意图;FIG. 9 is a schematic structural diagram of a third trigger provided by an embodiment of the present application;
图10为本申请实施例提供的第四种触发器的结构示意图;FIG. 10 is a schematic structural diagram of a fourth trigger provided by an embodiment of the present application;
图11为本申请实施例提供的第五种触发器的结构示意图;FIG. 11 is a schematic structural diagram of a fifth trigger provided by an embodiment of the present application;
图12为本申请实施例提供的第六种触发器的结构示意图;FIG. 12 is a schematic structural diagram of a sixth trigger provided by an embodiment of the present application;
图13为本申请实施例提供的第七种触发器的结构示意图;FIG. 13 is a schematic structural diagram of a seventh trigger provided by an embodiment of the present application;
图14为本申请实施例提供的第八种触发器的结构示意图。FIG. 14 is a schematic structural diagram of an eighth trigger provided by an embodiment of the present application.
通常,D触发器可以由低通锁存器和高通锁存器组成,如图3所示。图3中,低通锁存器中包含两个钟控反相器(即第一钟控反相器I1和第二钟控反相器I2)以及一个反相器(I3),高通锁存器中包含两个钟控反相器(第三钟控反相器I4和第四钟控反相器I5)以及一个反相器(I6)。其中,I3和I6一直处于导通状态,I1和I5在时钟信号为低电平时导通,I2和I4在时钟信号为高电平时导通。Typically, a D flip-flop can consist of a low pass latch and a high pass latch, as shown in FIG. In Figure 3, the low-pass latch contains two clocked inverters (ie, first clocked inverter I1 and second clocked inverter I2) and one inverter (I3), high-pass latch The controller includes two clocked inverters (a third clocked inverter I4 and a fourth clocked inverter I5) and an inverter (I6). Among them, I3 and I6 are always in the on state, I1 and I5 are turned on when the clock signal is low, and I2 and I4 are turned on when the clock signal is high.
该触发器的工作原理如下:当输入的时钟信号为低电平时,低通锁存器把输入端D的逻辑值传送至节点A,再被传送至节点B。此时I2和I4关断,高通锁存器的节点C上保持着前一个时钟信号上升沿时锁存的数据,该数据被传送至触发器的输出端Q。当输入的时钟信号转为高电平时,I1和I5关断,I2和I4导通,低通锁存器的I2和I3进行锁存,高通锁存器把输入端B逻辑值传送至节点C,节点C数据进行更新,再被传送至节点Q,即完成输入端D的逻辑值传送至触发器的输出端Q的过程。The flip-flop works as follows: When the input clock signal is low, the low-pass latch transfers the logic value of input D to node A and then to node B. At this time, I2 and I4 are turned off, and the data latched on the rising edge of the previous clock signal is held on the node C of the high-pass latch, and the data is transmitted to the output terminal Q of the flip-flop. When the input clock signal goes high, I1 and I5 are turned off, I2 and I4 are turned on, I2 and I3 of the low-pass latch are latched, and the high-pass latch transfers the logic value of input B to node C. The node C data is updated and then transmitted to the node Q, that is, the process of transferring the logical value of the input terminal D to the output terminal Q of the flip-flop.
通过如上原理可以看出,图3所示的D触发器为上升沿触发的D触发器,即时钟信号的上升沿会触发该触发器锁存输入的数据信号的电平状态,然后通过Q管脚输出采集到的电平。As can be seen from the above principle, the D flip-flop shown in FIG. 3 is a rising edge triggered D flip-flop, that is, the rising edge of the clock signal triggers the level state of the data signal input by the flip-flop latch, and then passes through the Q tube. The level at which the foot output is acquired.
需要说明的是,在图3所示的触发器中,当输入的时钟信号为低电平时,可通过I1、I2和I3的配合将输入端D的逻辑值传送至节点B,因此将I1、I2和I3组成的锁存器称为低通锁存器。当输入的时钟信号转为高电平时,可通过I4、I5和I6的配合把输入端B的逻辑值传送至节点Q,因此,将I4、I5和I6组成的锁存器称为高通锁存器。It should be noted that, in the flip-flop shown in FIG. 3, when the input clock signal is low level, the logic value of the input terminal D can be transmitted to the node B through the cooperation of I1, I2, and I3, so I1 is The latches consisting of I2 and I3 are called low-pass latches. When the input clock signal goes high, the logic value of input B can be transferred to node Q through the cooperation of I4, I5 and I6. Therefore, the latch composed of I4, I5 and I6 is called high-pass latch. Device.
低通锁存器在时钟信号为低电平时传送信号,是通过配置I1和I2的导通特性来实现的;同样地,高通锁存器在时钟信号为高电平时传送信号,是通过配置I4和I5的导通特 性来实现的。在图3中,将I1和I5配置为高电平导通的钟控反相器,将I2和I4配置为低电平导通的钟控反相器。The low-pass latch transmits the signal when the clock signal is low, by configuring the turn-on characteristics of I1 and I2. Similarly, the high-pass latch transmits the signal when the clock signal is high, by configuring I4. And the conduction characteristics of I5 are realized. In Figure 3, I1 and I5 are configured as clocked inverters that are turned on at a high level, and I2 and I4 are configured as clocked inverters that are turned on at a low level.
那么,不难想象,若对I1和I2的导通特性进行与图3不同的配置(例如将I1配置为低电平导通的钟控反相器,将I2配置为高电平导通的钟控反相器),I1、I2和I3组成的锁存器可以为高通锁存器;若对I4和I5的导通特性进行与图3不同的配置(例如将I4配置为高电平导通的钟控反相器,将I5配置为低电平导通的钟控反相器),I4、I5和I6组成的锁存器可以为低通锁存器。此时,可通过I1、I2、I3、I4、I5和I6实现下降沿触发的D触发器,其工作原理与上升沿触发的D触发器的工作原理相似,此处不再赘述。Then, it is not difficult to imagine that if the conduction characteristics of I1 and I2 are different from those of Figure 3 (for example, I1 is configured as a low-level clocked inverter, I2 is configured to be high-level. Clocked inverter), the latches composed of I1, I2 and I3 can be high-pass latches; if the conduction characteristics of I4 and I5 are different from those of Figure 3 (for example, I4 is configured as a high-level The clocked inverter is configured to configure I5 as a low-level clocked inverter. The latches of I4, I5, and I6 can be low-pass latches. At this time, the falling edge triggered D flip-flop can be realized by I1, I2, I3, I4, I5 and I6, and its working principle is similar to that of the rising edge triggered D flip-flop, and will not be described here.
如背景技术中所述,针对图3所示的D触发器,在时钟信号的上升沿附近定义了一个时间窗口,若在该时间窗口上输入的数据信号din发生了电平翻转,可能会导致D触发器内的某些节点无法稳定在逻辑0或逻辑1的电平状态,从而导致D触发器出现亚稳态现象。As described in the background art, for the D flip-flop shown in FIG. 3, a time window is defined near the rising edge of the clock signal, and if the data signal din input on the time window is level-inverted, it may result in Some nodes in the D flip-flop cannot be stabilized at the logic 0 or logic 1 level state, resulting in a meta-stable phenomenon of the D flip-flop.
其中,该时间窗口可以由上升沿之前的建立时间(setup time)(即图2中的Ts)和上升沿之后的保持时间(hold time)(即图2中的Th)组成。也就是说,在时钟信号的上升沿到来之前的Ts时间内、以及上升沿到来之后的Th时间内,原则上输入的数据信号din不允许发生电平翻转。若数据信号din在Ts或Th中的任意时刻发生电平翻转,则会导致触发器出现亚稳态现象。The time window may be composed of a setup time before the rising edge (ie, Ts in FIG. 2) and a hold time after the rising edge (ie, Th in FIG. 2). That is to say, in the Ts time before the rising edge of the clock signal and the Th time after the rising edge comes, the data signal din input in principle is not allowed to be level-inverted. If the data signal din is level-over at any time in Ts or Th, the trigger will appear metastable.
为了降低触发器出现亚稳态现象的概率,可以将多个D触发器级联。如图4所示,为一种通过三个D触发器级联的方式来避免亚稳态现象的触发器系统。在该系统中,若第一级D触发器出现亚稳态现象,由于第一级D触发器的输出最终会稳定在逻辑0或逻辑1,那么第二级D触发器或者第三级D触发器在接收到稳定的逻辑电平后会消除亚稳态现象。To reduce the probability of a metastable phenomenon in a flip-flop, multiple D flip-flops can be cascaded. As shown in FIG. 4, it is a trigger system that avoids metastable phenomena by cascading three D flip-flops. In this system, if the first-stage D flip-flop appears metastable, since the output of the first-stage D flip-flop will eventually stabilize at logic 0 or logic 1, then the second-level D flip-flop or the third-level D-trigger The receiver eliminates metastability after receiving a stable logic level.
示例性地,该触发器系统的输入输出时序图可以如图5所示。图5中,由于在第一个时钟信号上升沿的时间窗口内,第一级D触发器的输入的数据信号发生电平翻转,因而第一级D触发器出现亚稳态现象。经过第一级D触发器的决断时间之后,第一级D触发器在第二个时钟信号上升沿到来之前稳定在逻辑1。由于在第二个时钟信号上升沿的时间窗口内,第二级D触发器的输入信号没有发生电平翻转,因而在第二级D触发器即可将亚稳态消除。Illustratively, the input and output timing diagram of the trigger system can be as shown in FIG. In FIG. 5, since the input data signal of the first-stage D flip-flop is level-inverted during the time window of the rising edge of the first clock signal, the first-stage D flip-flop exhibits a metastable state. After the decision time of the first stage D flip-flop, the first stage D flip-flop settles to logic 1 before the rising edge of the second clock signal. Since the input signal of the second stage D flip-flop does not level flip during the time window of the rising edge of the second clock signal, the metastable state can be eliminated in the second stage D flip-flop.
示例性地,该触发器系统的输入输出时序图可以如图6所示。图6中,由于在第一个时钟信号上升沿的时间窗口内,第一级D触发器的输入的数据信号发生电平翻转,因而第一级D触发器出现亚稳态现象。第二个时钟信号上升沿到来时第一级D触发器还处于决断时间,因而第一级D触发器在第二个时钟信号上升沿到来时仍处于亚稳态,第二级D触发器仍存在亚稳态现象。经过第二级D触发器的决断时间之后,第二级D触发器的输出在第三个时钟信号上升沿到来之前稳定在逻辑1。由于在第三个时钟信号上升沿的时间窗口内,第三级D触发器的输入信号没有发生电平翻转,因而在第三级D触发器即可将亚稳态消除。Illustratively, the input and output timing diagram of the trigger system can be as shown in FIG. 6. In Fig. 6, since the input data signal of the first stage D flip-flop is level-inverted during the time window of the rising edge of the first clock signal, the first-stage D flip-flop exhibits a metastable state. The first stage D flip-flop is still in the decision time when the rising edge of the second clock signal arrives, so the first stage D flip-flop is still metastable when the rising edge of the second clock signal arrives, and the second stage D flip-flop remains There is a metastable state. After the decision time of the second stage D flip-flop, the output of the second stage D flip-flop settles to logic 1 before the rising edge of the third clock signal. Since the input signal of the third-stage D flip-flop does not level flip during the time window of the rising edge of the third clock signal, the metastable state can be eliminated in the third-stage D flip-flop.
采用上述触发器级联的方式来消除触发器的亚稳态,需要将多个触发器级联,并最终采用最后一级D触发器的输出作为系统输出。由于级联的D触发器的数量越多,该系统发生亚稳态现象的概率越低,因此,为了降低发生亚稳态的概率,需要级联多级(例如三级或五级)D触发器,此时,由于需要经过多级D触发器才可将系统的输入信号锁存并输出,因而系统输出相对于系统输入来说会经过几个时钟信号周期的延迟,影响系统的性能。尤其在多个系统进行交互时,如果每个系统的信号延迟均较大,则会严重影响多系统交互的 性能。To eliminate the metastable state of the flip-flop by using the above-mentioned flip-flop cascade, multiple flip-flops need to be cascaded, and finally the output of the last-stage D flip-flop is used as the system output. Due to the greater number of cascaded D flip-flops, the lower the probability of metastable phenomena in the system, therefore, in order to reduce the probability of occurrence of metastability, cascaded multi-level (eg, three or five) D-triggering is required. At this time, since the input signal of the system can be latched and output through the multi-level D flip-flop, the system output will delay several clock signal cycles with respect to the system input, which affects the performance of the system. Especially when multiple systems interact, if the signal delay of each system is large, it will seriously affect the performance of multi-system interaction.
因此,本申请实施例提供一种触发器及集成电路,用以减小触发器出现亚稳态现象的概率,避免触发器输出信号出现逻辑误判、影响系统正常工作。Therefore, the embodiment of the present application provides a flip-flop and an integrated circuit, which are used to reduce the probability of a metastable phenomenon of a trigger, avoid logical misjudgment of the trigger output signal, and affect the normal operation of the system.
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。In order to make the objects, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
需要说明的是,本申请实施例中所涉及的多个,是指两个或两个以上。另外,需要理解的是,在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。It should be noted that the plurality of parts referred to in the embodiments of the present application refer to two or more. In addition, it should be understood that in the description of the embodiments of the present application, the terms "first", "second" and the like are used only to distinguish the purpose of description, and are not to be understood as indicating or suggesting relative importance, nor understanding. Indicated or implied order.
参见图7,为本申请实施例提供的一种触发器的结构示意图,用于在第一时钟信号的控制下对输入的数据信号进行锁存和输出。该触发器700包括第一锁存器701、第二锁存器702、延迟单元703、检测单元704、切换单元705以及第三锁存器706。其中,FIG. 7 is a schematic structural diagram of a flip-flop according to an embodiment of the present application, for latching and outputting an input data signal under control of a first clock signal. The flip-flop 700 includes a first latch 701, a second latch 702, a delay unit 703, a detecting unit 704, a switching unit 705, and a third latch 706. among them,
延迟单元703,用于将第一时钟信号延迟预设时间后得到并输出第二时钟信号。The delay unit 703 is configured to delay and output the second clock signal after delaying the first clock signal by a preset time.
第一锁存器701的时钟信号输入端与延迟单元703连接,以接收第二时钟信号;第一锁存器701用于根据第二时钟信号,对触发器700的数据输入端输入的数据信号进行锁存或输出。The clock signal input end of the first latch 701 is connected to the delay unit 703 to receive the second clock signal; the first latch 701 is configured to input the data signal to the data input end of the flip-flop 700 according to the second clock signal. Perform latching or output.
第二锁存器702用于根据第一时钟信号,对触发器700的数据输入端输入的数据信号进行锁存或输出。The second latch 702 is configured to latch or output a data signal input to the data input terminal of the flip-flop 700 according to the first clock signal.
检测单元704用于检测第一锁存器701或第二锁存器702是否处于亚稳态,并基于检测结果向切换单元705发送控制信号。The detecting unit 704 is configured to detect whether the first latch 701 or the second latch 702 is in a metastable state, and transmit a control signal to the switching unit 705 based on the detection result.
切换单元705的两个输入端分别与第一锁存器701的输出端和第二锁存器702的输出端连接,切换单元705用于根据控制信号,选择输出第一锁存器701的输出信号或者第二锁存器702的输出信号。The two input ends of the switching unit 705 are respectively connected to the output end of the first latch 701 and the output end of the second latch 702, and the switching unit 705 is configured to selectively output the output of the first latch 701 according to the control signal. The signal or the output signal of the second latch 702.
第三锁存器706的数据输入端与切换单元705的输出端连接,用于根据所述第一时钟信号,对切换单元705的输出信号进行锁存或输出。The data input end of the third latch 706 is coupled to the output of the switching unit 705 for latching or outputting the output signal of the switching unit 705 according to the first clock signal.
需要说明的是,本申请实施例中,检测单元704检测第一锁存器701或第二锁存器702是否处于亚稳态,其具体含义可以有两种:一、检测单元704仅对检测第一锁存器701或第二锁存器702中的一个锁存器是否处于亚稳态的情况进行检测;二、检测单元704同时对第一锁存器701和第二锁存器702这两个锁存器是否处于亚稳态的情况进行检测。在图7所示的触发器700中,示出了检测单元704仅检测第一锁存器701是否处于亚稳态的情况,或者检测单元704仅检测第二锁存器702是否处于亚稳态的情况(虚线表示)。实际实现时,检测单元704还可对第一锁存器701是否处于亚稳态的情形以及第二锁存器702是否处于亚稳态的情况均进行检测。It should be noted that, in the embodiment of the present application, the detecting unit 704 detects whether the first latch 701 or the second latch 702 is in a metastable state, and may have two specific meanings: Whether one of the first latch 701 or the second latch 702 is in a metastable state is detected; second, the detecting unit 704 simultaneously applies the first latch 701 and the second latch 702. Whether the two latches are in a metastable state is detected. In the flip-flop 700 shown in FIG. 7, it is shown that the detecting unit 704 detects only whether the first latch 701 is in a metastable state, or the detecting unit 704 detects only whether the second latch 702 is in a metastable state. The situation (indicated by the dotted line). In actual implementation, the detecting unit 704 can also detect whether the first latch 701 is in a metastable state and whether the second latch 702 is in a metastable state.
同样需要说明的是,本申请实施例中,第一锁存器701和第二锁存器702的导通特征相同,第三锁存器706和第一锁存器701的导通特性(即第二锁存器702的导通特性)相反。It should be noted that, in the embodiment of the present application, the conduction characteristics of the first latch 701 and the second latch 702 are the same, and the conduction characteristics of the third latch 706 and the first latch 701 (ie, The conduction characteristics of the second latch 702 are reversed.
示例性地,若第一锁存器701在时钟信号为高电平时传送信号,则第二锁存器702也在时钟信号为高电平时传送信号,第三锁存器706在时钟信号为低电平时传送信号;即,第一锁存器701和第二锁存器702为高通锁存器,第三锁存器706为低通锁存器。Illustratively, if the first latch 701 transmits a signal when the clock signal is high, the second latch 702 also transmits a signal when the clock signal is high, and the third latch 706 is low at the clock signal. The signal is transmitted at level; that is, the first latch 701 and the second latch 702 are high pass latches and the third latch 706 is a low pass latch.
示例性地,若第一锁存器701在时钟信号为低电平时传送信号,则第二锁存器702也 在时钟信号为低电平时传送信号,第三锁存器706在时钟信号为高电平时传送信号;即,第一锁存器701和第二锁存器702为低通锁存器,第三锁存器706为高通锁存器。Illustratively, if the first latch 701 transmits a signal when the clock signal is low, the second latch 702 also transmits a signal when the clock signal is low, and the third latch 706 is high at the clock signal. The signal is transmitted at the level; that is, the first latch 701 and the second latch 702 are low pass latches, and the third latch 706 is a high pass latch.
如前所述,在出现亚稳态现象时,触发器内的某些节点无法稳定在逻辑0或逻辑1的电平状态,而是徘徊在逻辑0和逻辑1之间的中间电平状态。As mentioned earlier, when a metastable state occurs, some nodes in the flip-flop cannot settle to the logic 0 or logic 1 level state, but lie between the intermediate level state between logic 0 and logic 1.
示例性地,若输入的数据信号发生电平翻转的时刻正好处于第一时钟信号的时间窗口内,则第二锁存器702可能出现亚稳态现象,第二锁存器702内的某些节点无法稳定在逻辑0或逻辑1的电平状态。若输入的数据信号发生电平翻转的时刻正好处于第二时钟信号的时间窗口内,则第一锁存器701可能出现亚稳态现象,第一锁存器701内的某些节点无法稳定在逻辑0或逻辑1的电平状态。Illustratively, if the time at which the input data signal is level-inverted is within the time window of the first clock signal, the second latch 702 may exhibit a metastable state, and some of the second latch 702 The node cannot be stable at the logic 0 or logic 1 level state. If the time at which the input data signal is level-inverted is within the time window of the second clock signal, the first latch 701 may exhibit a metastable state, and some nodes in the first latch 701 cannot be stabilized. The level state of logic 0 or logic 1.
因此,检测单元704在检测到第一锁存器701的某些节点处于逻辑0和逻辑1之间的中间电平状态时,则可以确定第一锁存器701处于亚稳态;检测单元704在检测到第二锁存器702的某些节点处于逻辑0和逻辑1之间的中间电平状态时,则可以确定第二锁存器702处于亚稳态。Therefore, when detecting that some nodes of the first latch 701 are in an intermediate level state between logic 0 and logic 1, the detecting unit 704 may determine that the first latch 701 is in a metastable state; the detecting unit 704 Upon detecting that some of the nodes of the second latch 702 are in an intermediate level state between logic 0 and logic 1, then it may be determined that the second latch 702 is in a metastable state.
在图7所示的触发器700中,第二锁存器702所采用的时钟信号为输入触发器700的第一时钟信号,而第一锁存器701所采用的时钟信号为第一时钟信号经过延迟单元703延迟后得到的第二时钟信号。由于第一时钟信号和第二时钟信号存在相位差,那么不难看出,触发器700中输入的数据信号发生电平翻转的时刻,若正处于第一时钟信号的时间窗口内(即第二锁存器702处于亚稳态),则通常不会处于第二时钟信号的时间窗口内(即第一锁存器701不处于亚稳态)。同样地,触发器700中输入的数据信号发生电平翻转的时刻,若正处于第二时钟信号的时间窗口内(即第一锁存器701处于亚稳态),则通常不会处于第一时钟信号的时间窗口内(即第二锁存器702不处于亚稳态)。In the flip-flop 700 shown in FIG. 7, the clock signal used by the second latch 702 is the first clock signal of the input flip-flop 700, and the clock signal used by the first latch 701 is the first clock signal. The second clock signal obtained after the delay unit 703 is delayed. Since there is a phase difference between the first clock signal and the second clock signal, it is not difficult to see that the time at which the data signal input in the flip-flop 700 is level-reversed is within the time window of the first clock signal (ie, the second lock) 702 is in metastable state and is typically not within the time window of the second clock signal (ie, first latch 701 is not in metastable state). Similarly, the time at which the data signal input in the flip-flop 700 is level-inverted is normally not in the first time if it is within the time window of the second clock signal (ie, the first latch 701 is in metastable state). Within the time window of the clock signal (ie, the second latch 702 is not in metastable state).
也就是说,第一锁存器701和第二锁存器702通常不会同时处于亚稳态。That is, the first latch 701 and the second latch 702 are typically not simultaneously metastable.
那么,本申请实施例中,可通过检测单元704对第一锁存器701或第二锁存器702是否处于亚稳态的情形进行检测,在检测到第一锁存器701处于亚稳态时,则切换单元705选择输出第二锁存器702的输出信号;在检测到第二锁存器702处于亚稳态时,则切换单元705选择输出第一锁存器701的输出信号。Then, in the embodiment of the present application, whether the first latch 701 or the second latch 702 is meta-stable can be detected by the detecting unit 704, and the first latch 701 is detected to be metastable. At this time, the switching unit 705 selects and outputs the output signal of the second latch 702; when detecting that the second latch 702 is in the metastable state, the switching unit 705 selects and outputs the output signal of the first latch 701.
在本申请实施例中,可选地,切换单元705可通过数据选择器实现。In the embodiment of the present application, optionally, the switching unit 705 can be implemented by a data selector.
通过如上操作,可以使得输出至第三锁存器706的输入端的信号处于稳定状态,从而使得触发器700的输出信号处于稳定状态,减小触发器700出现亚稳态现象的概率。By the above operation, the signal output to the input terminal of the third latch 706 can be made to be in a steady state, so that the output signal of the flip-flop 700 is in a steady state, reducing the probability that the flip-flop 700 exhibits a metastable state.
特别地,延迟单元703延迟的预设时间可以大于第一锁存器701的建立时间和保持时间之和,且小于第一时钟信号的信号周期。In particular, the preset time delayed by the delay unit 703 may be greater than the sum of the setup time and the hold time of the first latch 701 and less than the signal period of the first clock signal.
在预设时间采用如上设置的情况下,由于第一时钟信号和第二时钟信号的相位差大于第一时钟信号的时间窗口(即建立时间和保持时间之和)、且小于第一时钟信号的信号周期的一半,因而触发器700输入的数据信号发生电平翻转的时刻不可能同时处于第一时钟信号的时间窗口和第二时钟信号的时间窗口内。也就是说,第一锁存器701和第二锁存器702不可能同时处于亚稳态,那么切换单元704在选择输出第一锁存器701的输出信号和第二锁存器702的输出信号时,一定可以选择到一个稳定信号并输出。因此,在预设时间采用如上设置的情况下,可以进一步减小触发器700出现亚稳态现象的概率。In the case where the preset time is set as above, since the phase difference between the first clock signal and the second clock signal is greater than the time window of the first clock signal (ie, the sum of the setup time and the hold time), and is smaller than the first clock signal Half of the signal period, and thus the time at which the data signal input by the flip-flop 700 is level-flip cannot be simultaneously within the time window of the first clock signal and the time window of the second clock signal. That is, the first latch 701 and the second latch 702 are unlikely to be metastable at the same time, and the switching unit 704 is selectively outputting the output signal of the first latch 701 and the output of the second latch 702. When the signal is selected, it is possible to select a stable signal and output it. Therefore, in the case where the preset time is set as above, the probability that the flip-flop 700 exhibits a metastable state can be further reduced.
此外,预设时间小于第一时钟信号的信号周期,即可以使得第二时钟信号相较于第一 时钟信号的延迟较小(小于第一时钟信号的信号周期)。也就是说,在第二锁存器702发生亚稳态、切换单元705选择第一锁存器701的输出信号时,第一锁存器701的输出信号相较于第二锁存器702的输出信号的延迟时间较小,从而使得整个触发器700的输出信号延迟时间较小,该延迟时间小于第一时钟信号的信号周期。因此,采用这种设置,与图4所示的方案相比,可以减小输出信号的延迟时间。Further, the preset time is smaller than the signal period of the first clock signal, that is, the delay of the second clock signal compared to the first clock signal can be made smaller (less than the signal period of the first clock signal). That is, when the second latch 702 is metastable and the switching unit 705 selects the output signal of the first latch 701, the output signal of the first latch 701 is compared with that of the second latch 702. The delay time of the output signal is small, such that the output signal delay time of the entire flip-flop 700 is small, which is less than the signal period of the first clock signal. Therefore, with this arrangement, the delay time of the output signal can be reduced as compared with the scheme shown in FIG.
需要说明的是,本申请实施例中,通过设置预设时间大于第一时钟信号的建立时间和保持时间之和、且小于第一时钟信号的信号周期,可以进一步减小触发器700出现亚稳态现象的概率。但是,在实际实现时,预设时间也可以小于第一时钟信号的建立时间和保持时间之和,在这种设置下,也可以减小触发器700出现亚稳态现象的概率。其原因有两点:It should be noted that, in the embodiment of the present application, by setting the preset time to be greater than the sum of the setup time and the hold time of the first clock signal and less than the signal period of the first clock signal, the trigger 700 may be further stabilized. The probability of a state phenomenon. However, in actual implementation, the preset time may also be smaller than the sum of the setup time and the hold time of the first clock signal. Under this setting, the probability of the metastable phenomenon of the flip-flop 700 may also be reduced. There are two reasons for this:
一、第一时钟信号的时间窗口(建立时间和保持时间之和)和第二时钟信号的时间窗口(建立时间和保持时间之和)的值通常较小。在预设时间小于第一时钟信号的时间窗口的情况下,若数据信号发生电平翻转的时刻正好处于第一时钟信号的时间窗口,则该时刻有可能不处于第二时钟信号的时间窗口。即,采用第一时钟信号的第二锁存器702发生亚稳态现象时,采用第二时钟信号的第一锁存器701可能未发生亚稳态现象。也就是说,在预设时间小于第一时钟信号的时间窗口的情况下,采用本申请实施例提供的触发器700也会降低触发器出现亚稳态现象的概率。1. The value of the time window (sum of settling time and hold time) of the first clock signal and the time window of the second clock signal (sum of settling time and hold time) is usually small. In the case that the preset time is smaller than the time window of the first clock signal, if the time at which the data signal is level-inverted is just in the time window of the first clock signal, the time may not be in the time window of the second clock signal. That is, when the meta-stabilization phenomenon occurs in the second latch 702 employing the first clock signal, the first latch 701 employing the second clock signal may not have a metastable state. That is to say, in the case that the preset time is smaller than the time window of the first clock signal, the trigger 700 provided by the embodiment of the present application also reduces the probability of the metastable phenomenon of the trigger.
二、亚稳态现象的发生是一个概率事件,若数据信号发生电平翻转的时刻正好处于第一时钟信号的时间窗口内,则第二锁存器702有可能出现亚稳态现象,但并不是一定会发生亚稳态现象。同样地,若数据信号发生电平翻转的时刻正好处于第二时钟信号的时间窗口内,则第一锁存器701有可能出现亚稳态现象,但并不是一定会发生亚稳态现象。在预设时间小于第一时钟信号的时间窗口的情况下,即使数据信号发生电平翻转的时刻既处于第一时钟信号的时间窗口内又处于第二时钟信号的时间窗口内,第一锁存器701和第二锁存器702同时发生亚稳态现象的概率也要小于触发器中仅设置第一锁存器701或第二锁存器702的情况下发生亚稳态现象的概率。也就是说,由于本申请实施例提供的触发器700中提供了可以切换选择的第一锁存器701和第二锁存器702,因而在预设时间小于第一时钟信号的时间窗口的情况下,也会降低触发器700出现亚稳态的概率。Second, the occurrence of the metastable phenomenon is a probability event. If the time at which the data signal is level-inverted is within the time window of the first clock signal, the second latch 702 may have a metastable state, but Metastable phenomena do not necessarily occur. Similarly, if the time at which the data signal is level-inverted is within the time window of the second clock signal, the first latch 701 may have a metastable state, but metastable state does not necessarily occur. In the case that the preset time is smaller than the time window of the first clock signal, even if the time at which the data signal is level-inverted is within the time window of the first clock signal and within the time window of the second clock signal, the first latch The probability that the metastable phenomenon occurs simultaneously with the second latch 702 and the second latch 702 is also less than the probability that a metastable phenomenon occurs when only the first latch 701 or the second latch 702 is set in the flip-flop. That is, since the first latch 701 and the second latch 702 that can switch the selection are provided in the flip-flop 700 provided by the embodiment of the present application, the preset time is smaller than the time window of the first clock signal. The probability of a metastable state of the flip-flop 700 is also reduced.
如前所述,检测单元704用于检测第一锁存器701或第二锁存器702是否处于亚稳态。具体地,检测单元704在检测第一锁存器701或第二锁存器702是否处于亚稳态时,可以有两种具体实现方式。下面分别对这两种实现方式进行介绍。As previously described, the detection unit 704 is configured to detect whether the first latch 701 or the second latch 702 is in a metastable state. Specifically, when the detecting unit 704 detects whether the first latch 701 or the second latch 702 is in metastability, there are two specific implementations. The following two implementations are introduced separately.
第一种实现方式First implementation
在第一种实现方式中,检测单元704在检测第一锁存器701或第二锁存器702是否处于亚稳态时,可通过如下方式实现:检测单元702检测第一锁存器701或第二锁存器702中的检测节点是否处于亚稳态。In the first implementation, when detecting whether the first latch 701 or the second latch 702 is in metastability, the detecting unit 704 can be implemented as follows: the detecting unit 702 detects the first latch 701 or Whether the detected node in the second latch 702 is in metastability.
其中,检测节点可以是第一锁存器701中的任一节点,也可以是第二锁存器702中的任一节点。若检测节点是第一锁存器701中的节点,则检测单元704用于检测第一锁存器701是否处于亚稳态;若检测节点是第二锁存器702中的节点,则检测单元704用于检测第二锁存器702是否处于亚稳态.The detection node may be any one of the first latches 701 or any of the second latches 702. If the detecting node is a node in the first latch 701, the detecting unit 704 is configured to detect whether the first latch 701 is in metastable state; if the detecting node is a node in the second latch 702, the detecting unit 704 is used to detect whether the second latch 702 is in metastable state.
也就是说,在第一种实现方式中,检测单元704检测第一锁存器701和第二锁存器702中的某一个锁存器是否处于亚稳态即可。控制信号也仅指示某一个锁存器是否处于亚稳态 的情况。That is, in the first implementation, the detecting unit 704 detects whether one of the first latch 701 and the second latch 702 is in a metastable state. The control signal also only indicates if a particular latch is in a metastable state.
在第一种实现方式中,切换单元705在选择输出第一锁存器701的输出信号或第二锁存器702的输出信号时,可以这样选择:在当前检测的锁存器处于亚稳态时选择输出另一个锁存器的输出信号;在当前检测的锁存器不处于亚稳态时选择输出当前检测的锁存器的输出信号。In the first implementation, when the switching unit 705 selects to output the output signal of the first latch 701 or the output signal of the second latch 702, the switching unit 705 may select: the currently detected latch is in a metastable state. The output signal of the other latch is selected to be output; the output signal of the currently detected latch is selected to be output when the currently detected latch is not metastable.
具体地,切换单元705在根据控制信号,选择输出第一锁存器701的输出信号或第二锁存器702的输出信号时,具体可以通过如下方式实现:Specifically, when the switching unit 705 selects the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal, the switching unit 705 can be specifically implemented as follows:
1、若检测单元704用于检测第一锁存器701是否处于亚稳态,切换单元705在检测单元704检测到第一锁存器701处于亚稳态时,选择输出第二锁存器702的输出信号;切换单元705在检测单元704检测到第一锁存器701不处于亚稳态时,则选择输出第一锁存器701的输出信号。1. If the detecting unit 704 is configured to detect whether the first latch 701 is meta-stable, the switching unit 705 selects and outputs the second latch 702 when the detecting unit 704 detects that the first latch 701 is meta-stable. The output signal; the switching unit 705 selects and outputs the output signal of the first latch 701 when the detecting unit 704 detects that the first latch 701 is not in the metastable state.
2、若检测单元704用于检测第二锁存器702是否处于亚稳态,切换单元705在检测单元704检测到第二锁存器702处于亚稳态时,选择输出第一锁存器701的输出信号;切换单元705在检测单元704检测到第二锁存器702不处于亚稳态时,则选择输出第二锁存器702的输出信号。2. If the detecting unit 704 is configured to detect whether the second latch 702 is metastable, the switching unit 705 selects and outputs the first latch 701 when the detecting unit 704 detects that the second latch 702 is metastable. The output signal; the switching unit 705 selects to output the output signal of the second latch 702 when the detecting unit 704 detects that the second latch 702 is not in metastability.
也就是说,可将第一锁存器701和第二锁存器702中的任一锁存器作为主锁存器,将另一锁存器作为副锁存器。在主锁存器处于亚稳态时,切换单元705才暂时选择副锁存器的输出信号;一旦主锁存器恢复稳态,切换单元705即选择主锁存器的输出信号进行输出。That is, any one of the first latch 701 and the second latch 702 can be used as a master latch and the other latch as a secondary latch. When the master latch is in metastability, the switching unit 705 temporarily selects the output signal of the secondary latch; once the master latch returns to steady state, the switching unit 705 selects the output signal of the master latch for output.
具体地,在第一种实现方式中,检测单元704可以包括第一反相器、第二反相器和第一异或门电路。其中,Specifically, in the first implementation, the detecting unit 704 may include a first inverter, a second inverter, and a first exclusive OR gate circuit. among them,
第一反相器,与检测节点连接,用于在检测节点的电压大于或等于第一阈值时输出低电平,以及在检测节点的电压低于第一阈值时输出高电平。The first inverter is connected to the detecting node for outputting a low level when the voltage of the detecting node is greater than or equal to the first threshold, and outputting a high level when the voltage of the detecting node is lower than the first threshold.
第二反相器,与检测节点连接,用于在检测节点的电压大于或等于第二阈值时输出低电平,以及在检测节点的电压低于第二阈值时输出高电平,第二阈值小于第一阈值。a second inverter connected to the detecting node, configured to output a low level when the voltage of the detecting node is greater than or equal to the second threshold, and output a high level when the voltage of the detecting node is lower than the second threshold, the second threshold Less than the first threshold.
第一异或门电路,与第一反相器和第二反相器连接,用于对第一反相器的输出信号和第二反相器的输出信号进行异或操作,并将异或操作的结果作为控制信号输出至切换单元705。a first XOR gate circuit coupled to the first inverter and the second inverter for performing an exclusive OR operation on an output signal of the first inverter and an output signal of the second inverter, and The result of the operation is output to the switching unit 705 as a control signal.
如前所述,检测节点可以是第一锁存器701中的任一节点,也可以是第二锁存器702中的任一节点。该检测节点处于亚稳态,即代表该检测节点所在的锁存器处于亚稳态。As previously mentioned, the detection node can be any of the first latches 701 or any of the second latches 702. The detection node is in metastable state, that is, the latch representing the detection node is in a metastable state.
示例性地,当检测节点为第一锁存器701中的节点时,触发器700的结构可以如图8所示。Illustratively, when the detecting node is a node in the first latch 701, the structure of the flip-flop 700 can be as shown in FIG.
在图8所示的触发器700中,该检测单元704的工作原理如下:In the flip-flop 700 shown in FIG. 8, the detecting unit 704 works as follows:
当检测节点处于亚稳态时,检测节点会处于逻辑0和逻辑1之间的中间电平状态。由于第一反相器的第一阈值大于第二反相器的第二阈值,当检测节点的电平状态变化到小于第一阈值、且大于第二阈值的数值范围时,第一反相器输出高电平,第二反相器输出低电平,第一异或门电路输出高电平。When the detection node is in metastability, the detection node will be in an intermediate level state between logic 0 and logic 1. Since the first threshold of the first inverter is greater than the second threshold of the second inverter, when the level state of the detecting node changes to a value range smaller than the first threshold and greater than the second threshold, the first inverter The output is high, the second inverter outputs a low level, and the first XOR gate outputs a high level.
当检测节点不处于亚稳态时,检测节点稳定在高电平或低电平。若检测节点稳定在高电平,则第一反相器和第二反相器均输出低电平,第一异或门电路输出低电平;若检测节点稳定在低电平,则第一反相器和第二反相器均输出高电平,第一异或门电路输出低电平。When the detection node is not in metastability, the detection node is stable at a high level or a low level. If the detecting node is stable at a high level, the first inverter and the second inverter both output a low level, and the first XOR gate circuit outputs a low level; if the detecting node is stable at a low level, the first Both the inverter and the second inverter output a high level, and the first XOR gate outputs a low level.
通过如上工作原理的分析可知:当检测节点处于亚稳态时,第一异或门电路输出高电 平;当检测节点不处于亚稳态时,第一异或门电路输出低电平。因此,检测单元704输出的控制信号的电平状态即可表征第一锁存器701是否处于亚稳态,从而使得切换单元705可以在检测单元704输出的控制信号的控制下,选择性地输出第一锁存器701的输出信号或第二锁存器702的输出信号。例如,若检测单元704输出至切换单元705的控制信号为高电平,则切换单元705可确定第一锁存器701处于亚稳态,此时切换单元可选择输出第二锁存器702的输出信号,避免将亚稳态传递至下一级的第三锁存器706;若检测单元704输出至切换单元705的控制信号为低电平,则切换单元705可确定第一锁存器701不处于亚稳态,此时切换单元705可选择输出第一锁存器701的输出信号。Through the analysis of the above working principle, it can be known that when the detecting node is in metastable state, the first XOR gate circuit outputs a high level; when the detecting node is not in the metastable state, the first XOR gate circuit outputs a low level. Therefore, the level state of the control signal outputted by the detecting unit 704 can indicate whether the first latch 701 is in a metastable state, so that the switching unit 705 can selectively output under the control of the control signal output by the detecting unit 704. The output signal of the first latch 701 or the output signal of the second latch 702. For example, if the control signal outputted by the detecting unit 704 to the switching unit 705 is at a high level, the switching unit 705 may determine that the first latch 701 is in a metastable state, and at this time, the switching unit may select to output the second latch 702. Outputting a signal to avoid transferring the metastable state to the third latch 706 of the next stage; if the control signal outputted by the detecting unit 704 to the switching unit 705 is a low level, the switching unit 705 may determine the first latch 701 Not in the metastable state, the switching unit 705 can select to output the output signal of the first latch 701.
需要说明的是,以上对检测单元704的结构的介绍仅为一种示例,实际实现时,检测单元704不限于上述结构。比如,第一反相器和第二反相器也可以通过两个阈值不同的电压比较器实现。再比如,在检测单元704中,第一异或门电路也可以用同或门电路实现。当采用同或门电路实现时,切换单元705在根据检测单元704输出的控制信号判断输出第一锁存器701的输出信号还是第二锁存器702的输出信号时,与采用异或门电路实现时的判断逻辑相反,具体实现方式此处不再赘述。It should be noted that the above description of the structure of the detecting unit 704 is merely an example. In actual implementation, the detecting unit 704 is not limited to the above structure. For example, the first inverter and the second inverter can also be implemented by two voltage comparators having different threshold values. For another example, in the detecting unit 704, the first XOR gate circuit can also be implemented by the same OR gate circuit. When implemented by the same OR gate circuit, the switching unit 705 determines whether to output the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal outputted by the detecting unit 704, and adopts an exclusive OR gate circuit. The judgment logic at the time of implementation is reversed, and the specific implementation manner will not be described here.
在第一种实现方式中,当检测节点为第一锁存器701中的节点时,第一锁存器701的结构组成可以有两种。In the first implementation, when the detecting node is a node in the first latch 701, the first latch 701 may have two structural components.
第一种The first
第一锁存器701可以包括第一钟控反相器、第二钟控反相器和第三反相器。其中,第一钟控反相器的输入端输入数据信号,第一钟控反相器的输出端作为检测节点与检测单元704连接,且与第三反相器的输入端连接;第三反相器的输出端输出的信号作为第一锁存器701的输出信号;第二钟控反相器的输入端与第三反相器的输出端连接,第二钟控反相器的输出端与第一钟控反相器的输出端连接。此外,第一钟控反相器和第二钟控反相器在第二时钟信号下交替导通。The first latch 701 may include a first clocked inverter, a second clocked inverter, and a third inverter. Wherein, the input end of the first clocked inverter inputs a data signal, and the output end of the first clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the third inverter; The signal outputted from the output of the phase comparator serves as the output signal of the first latch 701; the input of the second clocked inverter is connected to the output of the third inverter, and the output of the second clocked inverter Connected to the output of the first clocked inverter. Furthermore, the first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
第一锁存器701采用第一种结构时,触发器700的结构可以如图9所示。When the first latch 701 adopts the first structure, the structure of the flip-flop 700 can be as shown in FIG.
其中,第一钟控反相器和第二钟控反相器交替导通,可以通过如下方式设置:第一钟控反相器在第二时钟信号的上升沿触发导通,第二钟控反相器在第二时钟信号的下降沿触发导通;或者,第一钟控反相器在第二时钟信号的下降沿触发导通,第二钟控反相器在第二时钟信号的上升沿触发导通。Wherein, the first clocked inverter and the second clocked inverter are alternately turned on, and can be set by: the first clocked inverter triggers conduction on the rising edge of the second clock signal, and the second clock is controlled The inverter triggers the conduction on the falling edge of the second clock signal; or the first clocked inverter triggers the conduction on the falling edge of the second clock signal, and the second clocked inverter rises in the second clock signal The edge is turned on.
当第一锁存器701采用如上结构时,若第一锁存器701处于亚稳态,则切换单元705选择输出第二锁存器702的输出信号。当第一锁存器701的决断时间结束,第一锁存器701最终会随机地稳定在逻辑0或逻辑1,此时,检测单元704检测到第一锁存器701不处于亚稳态,则切换单元705会根据检测单元704输出的控制信号,选择输出第一锁存器701的输出信号。When the first latch 701 adopts the above structure, if the first latch 701 is in metastable state, the switching unit 705 selects and outputs the output signal of the second latch 702. When the decision time of the first latch 701 ends, the first latch 701 eventually randomly stabilizes at logic 0 or logic 1, and at this time, the detecting unit 704 detects that the first latch 701 is not in metastable state. Then, the switching unit 705 selects and outputs the output signal of the first latch 701 according to the control signal output by the detecting unit 704.
也就是说,第二锁存器702在第一锁存器701处于亚稳态时代替第一锁存器701向第三锁存器706输出信号,在第一锁存器701恢复稳态时则第二锁存器702不起作用。That is, the second latch 702 outputs a signal to the third latch 706 instead of the first latch 701 when the first latch 701 is in the metastable state, when the first latch 701 returns to the steady state. Then the second latch 702 does not function.
第二种Second
第一锁存器701包括第一钟控反相器、第二钟控反相器和第三反相器;其中,第一钟控反相器的输入端输入数据信号,第一钟控反相器的输出端作为检测节点与检测单元704连接,且与第三反相器的输入端连接;第三反相器的输出端输出的信号作为第一锁存器701的输出信号;第二钟控反相器的输入端作为第一锁存器701的反馈端与切换单元705的输 出端连接,第二钟控反相器的输出端与第一钟控反相器的输出端连接。此外,第一钟控反相器和第二钟控反相器在第二时钟信号下交替导通。The first latch 701 includes a first clocked inverter, a second clocked inverter, and a third inverter; wherein the input end of the first clocked inverter inputs a data signal, and the first clocked reverse The output end of the phase detector is connected as a detecting node to the detecting unit 704 and is connected to the input end of the third inverter; the signal outputted from the output end of the third inverter is used as an output signal of the first latch 701; The input end of the clocked inverter is connected as the feedback end of the first latch 701 to the output of the switching unit 705, and the output of the second clocked inverter is connected to the output of the first clocked inverter. Furthermore, the first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
第一锁存器701采用第二种结构时,触发器700的结构可以如图10所示。When the first latch 701 adopts the second structure, the structure of the flip-flop 700 can be as shown in FIG.
其中,第一钟控反相器和第二钟控反相器交替导通,可以通过如下方式设置:第一钟控反相器在第二时钟信号的上升沿触发导通,第二钟控反相器在第二时钟信号的下降沿触发导通;或者,第一钟控反相器在第二时钟信号的下降沿触发导通,第二钟控反相器在第二时钟信号的上升沿触发导通。Wherein, the first clocked inverter and the second clocked inverter are alternately turned on, and can be set by: the first clocked inverter triggers conduction on the rising edge of the second clock signal, and the second clock is controlled The inverter triggers the conduction on the falling edge of the second clock signal; or the first clocked inverter triggers the conduction on the falling edge of the second clock signal, and the second clocked inverter rises in the second clock signal The edge is turned on.
当第一锁存器701采用图10所示的结构时,若第一锁存器701处于亚稳态,则切换单元705选择输出第二锁存器702的输出信号。此时,切换单元705输出的是一个稳定的信号。由于切换单元705的输出端与第一锁存器701的反馈端(即第二钟控反相器的输入端)连接、且第二钟控反相器的输出端与检测节点连接,因而第二钟控反相器可将切换单元705输出的稳定电平反馈至检测节点,从而消除检测节点的亚稳态。此时,检测单元704检测到检测节点不处于亚稳态(即第一锁存器701未处于亚稳态),从而控制切换单元705选择输出第一锁存器701的输出信号。When the first latch 701 adopts the configuration shown in FIG. 10, if the first latch 701 is in metastable state, the switching unit 705 selects and outputs the output signal of the second latch 702. At this time, the switching unit 705 outputs a stable signal. Since the output end of the switching unit 705 is connected to the feedback end of the first latch 701 (ie, the input end of the second clocked inverter), and the output end of the second clocked inverter is connected to the detecting node, The second clocked inverter can feed back the stable level of the output of the switching unit 705 to the detecting node, thereby eliminating the metastability of the detecting node. At this time, the detecting unit 704 detects that the detecting node is not in metastability (ie, the first latch 701 is not in metastable state), so that the control switching unit 705 selects and outputs the output signal of the first latch 701.
第一锁存器701采用第二种结构时,由于反馈端可以将稳定电平反馈至检测节点,因而与第一锁存器701采用第一种结构的方案相比,检测节点的亚稳态可以在更短的时间内被消除,切换单元705可在亚稳态消除后选择输出第一锁存器701的输出信号。When the first latch 701 adopts the second structure, since the feedback terminal can feed back the stable level to the detecting node, the metastable state of the detecting node is detected compared with the scheme in which the first latch 701 adopts the first structure. Can be eliminated in a shorter time, the switching unit 705 can select to output the output signal of the first latch 701 after the metastable cancellation.
以上是在检测单元704检测第一锁存器701是否处于亚稳态的情形下,对第一锁存器701的结构的介绍。此外,在该情形下,第二锁存器702的结构可以参照图9中第一锁存器701的结构,此处不再赘述。The above is an introduction to the structure of the first latch 701 in the case where the detecting unit 704 detects whether the first latch 701 is meta-stable. In addition, in this case, the structure of the second latch 702 can refer to the structure of the first latch 701 in FIG. 9, and details are not described herein again.
在第一种实现方式中,当检测节点为第二锁存器702中的节点时,第二锁存器702的结构组成可以有两种。In the first implementation, when the detection node is a node in the second latch 702, the second latch 702 may have two structural components.
第一种The first
第二锁存器702包括第三钟控反相器、第四钟控反相器和第四反相器。其中,第三钟控反相器的输入端输入数据信号,第三钟控反相器的输出端作为检测节点与检测单元704连接,且与第四反相器的输入端连接;第四反相器的输出端输出的信号作为第二锁存器702的输出信号;第四钟控反相器的输入端与第四反相器的输出端连接,第四钟控反相器的输出端与第三钟控反相器的输出端连接。此外,第三钟控反相器和第四钟控反相器在第一时钟信号下交替导通。The second latch 702 includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter. Wherein, the input end of the third clocked inverter inputs a data signal, and the output end of the third clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the fourth inverter; The signal outputted from the output of the phase comparator serves as the output signal of the second latch 702; the input of the fourth clocked inverter is connected to the output of the fourth inverter, and the output of the fourth clocked inverter Connected to the output of the third clocked inverter. In addition, the third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
第二锁存器702采用第一种结构时,触发器700的结构可以如图11所示。When the second latch 702 adopts the first structure, the structure of the flip-flop 700 can be as shown in FIG.
其中,第三钟控反相器和第四钟控反相器交替导通,可以通过如下方式设置:第三钟控反相器在第一时钟信号的上升沿触发导通,第四钟控反相器在第一时钟信号的下降沿触发导通;或者,第三钟控反相器在第一时钟信号的下降沿触发导通,第四钟控反相器在第一时钟信号的上升沿触发导通。Wherein, the third clocked inverter and the fourth clocked inverter are alternately turned on, and can be set as follows: the third clocked inverter triggers conduction on the rising edge of the first clock signal, and the fourth clock control The inverter triggers the conduction on the falling edge of the first clock signal; or the third clocked inverter triggers the conduction on the falling edge of the first clock signal, and the fourth clocked inverter rises in the first clock signal The edge is turned on.
当第二锁存器702采用如上结构时,若第二锁存器702处于亚稳态,则切换单元705选择输出第一锁存器701的输出信号。当第二锁存器702的决断时间结束,第二锁存器702最终会随机地稳定在逻辑0或逻辑1,此时,检测单元704检测到第二锁存器702不处于亚稳态,则切换单元705会根据检测单元704输出的控制信号,选择输出第二锁存器702的输出信号。When the second latch 702 adopts the above structure, if the second latch 702 is in metastable state, the switching unit 705 selects and outputs the output signal of the first latch 701. When the decision time of the second latch 702 ends, the second latch 702 will eventually stabilize at logic 0 or logic 1 at random. At this time, the detecting unit 704 detects that the second latch 702 is not in the metastable state. Then, the switching unit 705 selects and outputs the output signal of the second latch 702 according to the control signal output by the detecting unit 704.
也就是说,第一锁存器701在第二锁存器702处于亚稳态时代替第二锁存器702向第 三锁存器706输出信号,在第二锁存器702恢复稳态时则第一锁存器701不起作用。That is, the first latch 701 outputs a signal to the third latch 706 instead of the second latch 702 when the second latch 702 is in metastability, when the second latch 702 returns to steady state. Then the first latch 701 does not function.
第二种Second
第二锁存器702包括第三钟控反相器、第四钟控反相器和第四反相器。其中,第三钟控反相器的输入端输入数据信号,第三钟控反相器的输出端作为检测节点与检测单元704连接,且与第四反相器的输入端连接;第四反相器的输出端输出的信号作为第二锁存器702的输出信号;第四钟控反相器的输入端作为第二锁存器702的反馈端与切换单元705的输出端连接,第四钟控反相器的输出端与第三钟控反相器的输出端连接。此外,第三钟控反相器和第四钟控反相器在第一时钟信号下交替导通。The second latch 702 includes a third clocked inverter, a fourth clocked inverter, and a fourth inverter. Wherein, the input end of the third clocked inverter inputs a data signal, and the output end of the third clocked inverter is connected as a detecting node to the detecting unit 704, and is connected to the input end of the fourth inverter; The signal outputted from the output of the phase converter is used as the output signal of the second latch 702; the input end of the fourth clocked inverter is connected as the feedback end of the second latch 702 to the output of the switching unit 705, fourth The output of the clocked inverter is connected to the output of the third clocked inverter. In addition, the third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
第二锁存器702采用第二种结构时,触发器700的结构可以如图12所示。When the second latch 702 adopts the second structure, the structure of the flip-flop 700 can be as shown in FIG.
其中,第三钟控反相器和第四钟控反相器交替导通,可以通过如下方式设置:第三钟控反相器在第一时钟信号的上升沿触发导通,第四钟控反相器在第一时钟信号的下降沿触发导通;或者,第三钟控反相器在第一时钟信号的下降沿触发导通,第四钟控反相器在第一时钟信号的上升沿触发导通。Wherein, the third clocked inverter and the fourth clocked inverter are alternately turned on, and can be set as follows: the third clocked inverter triggers conduction on the rising edge of the first clock signal, and the fourth clock control The inverter triggers the conduction on the falling edge of the first clock signal; or the third clocked inverter triggers the conduction on the falling edge of the first clock signal, and the fourth clocked inverter rises in the first clock signal The edge is turned on.
当第一锁存器701采用图12所示的结构时,若第二锁存器702处于亚稳态,则切换单元705选择输出第一锁存器701的输出信号。此时,切换单元705输出的是一个稳定的信号。由于切换单元705的输出端与第二锁存器702的反馈端(即第四钟控反相器的输入端)连接、且第四钟控反相器的输出端与检测节点连接,因而第四钟控反相器可将切换单元705输出的稳定电平反馈至检测节点,从而消除检测节点的亚稳态。此时,检测单元704检测到检测节点不处于亚稳态(即第二锁存器702未处于亚稳态),从而控制切换单元705选择输出第二锁存器702的输出信号。When the first latch 701 adopts the configuration shown in FIG. 12, if the second latch 702 is in metastable state, the switching unit 705 selects and outputs the output signal of the first latch 701. At this time, the switching unit 705 outputs a stable signal. Since the output end of the switching unit 705 is connected to the feedback end of the second latch 702 (ie, the input end of the fourth clocked inverter), and the output end of the fourth clocked inverter is connected to the detecting node, The four-clocked inverter can feed back the stable level of the output of the switching unit 705 to the detecting node, thereby eliminating the metastability of the detecting node. At this time, the detecting unit 704 detects that the detecting node is not in metastability (ie, the second latch 702 is not in metastable state), so that the control switching unit 705 selects and outputs the output signal of the second latch 702.
第二锁存器702采用第二种结构时,由于反馈端可以将稳定电平反馈至检测节点,因而与第二锁存器702采用第一种结构的方案相比,检测节点的亚稳态可以在更短的时间内被消除,切换单元705可在亚稳态消除后选择输出第二锁存器702的输出信号。When the second latch 702 adopts the second structure, since the feedback terminal can feed back the stable level to the detecting node, the metastable state of the detecting node is detected compared with the scheme in which the second latch 702 adopts the first structure. Can be eliminated in a shorter time, the switching unit 705 can select to output the output signal of the second latch 702 after the metastable cancellation.
以上是在检测单元704检测第二锁存器702是否处于亚稳态的情形下,对第二锁存器702的结构的介绍。此外,在该情形下,第一锁存器701的结构可以参照图11中第二锁存其702的结构,此处不再赘述。The above is an introduction to the structure of the second latch 702 in the case where the detecting unit 704 detects whether the second latch 702 is meta-stable. In addition, in this case, the structure of the first latch 701 can refer to the structure of the second latch 702 in FIG. 11 , and details are not described herein again.
以上是对检测单元704检测第一锁存器701或第二锁存器702是否处于亚稳态的第一种实现方式进行的介绍,下面介绍第二种实现方式。The above is an introduction to the first implementation in which the detecting unit 704 detects whether the first latch 701 or the second latch 702 is metastable. The second implementation is described below.
第二种实现方式Second implementation
在第二种实现方式中,检测单元在检测第一锁存器或第二锁存器是否处于亚稳态时,可通过如下方式实现:检测单元检测第一锁存器中的第一检测节点是否处于亚稳态,以及检测第二锁存器中的第二检测节点是否处于亚稳态。In a second implementation manner, when detecting whether the first latch or the second latch is in a metastable state, the detecting unit may be implemented by: detecting, by the detecting unit, the first detecting node in the first latch Whether it is in metastability and detecting whether the second detection node in the second latch is in metastable state.
也就是说,检测单元704对第一锁存器701和第二锁存器702是否处于亚稳态的情况均进行检测。控制信号指示第一锁存器701是否处于亚稳态的情况以及第二锁存器702是否处于亚稳态的情况。That is, the detecting unit 704 detects whether the first latch 701 and the second latch 702 are in a metastable state. The control signal indicates whether the first latch 701 is in a metastable state and whether the second latch 702 is in a metastable state.
采用第二种实现方式,切换单元705在根据控制信号,选择输出第一锁存器701的输出信号或第二锁存器702的输出信号时,具体可以通过如下方式实现:切换单元705在检测单元704检测到第一锁存器701处于亚稳态时,选择输出第二锁存器702的输出信号。此后,切换单元705一直选择输出第二锁存器702的输出信号,直至检测单元704检测到 第二锁存器702处于亚稳态,切换单元705才选择输出第一锁存器701的输出信号。此后,切换单元705一直选择输出第一锁存器701的输出信号,直至检测单元704检测到第一锁存器701处于亚稳态,切换单元705才选择输出第二锁存器702的输出信号。With the second implementation, when the switching unit 705 selects the output signal of the first latch 701 or the output signal of the second latch 702 according to the control signal, the switching unit 705 can be specifically implemented as follows: the switching unit 705 is detecting When unit 704 detects that first latch 701 is in metastability, it selects to output an output signal of second latch 702. Thereafter, the switching unit 705 selects and outputs the output signal of the second latch 702 until the detecting unit 704 detects that the second latch 702 is in metastability, and the switching unit 705 selects to output the output signal of the first latch 701. . Thereafter, the switching unit 705 always selects the output signal of the first latch 701 until the detecting unit 704 detects that the first latch 701 is metastable, and the switching unit 705 selects the output signal of the second latch 702. .
也就是说,切换单元705在选择输出信号时仅由当前输出信号对应的锁存器的状态确定。即,在当前输出信号对应的锁存器处于稳态时,无论另一锁存器处于何种状态,切换单元705一直选择输出当前的输出信号;仅在当前输出信号对应的锁存器处于亚稳态时,切换单元705才选择输出另一锁存器的输出信号。That is to say, the switching unit 705 determines only the state of the latch corresponding to the current output signal when the output signal is selected. That is, when the latch corresponding to the current output signal is in a steady state, the switching unit 705 selects to output the current output signal regardless of the state of the other latch; only the latch corresponding to the current output signal is in the sub-state At steady state, the switching unit 705 selects to output the output signal of the other latch.
不难看出,第二种实现方式与第一种实现方式相比,检测单元704需要检测的节点增多了,但切换单元705在选择输出第一锁存器701的输出信号或第二锁存器702的输出信号时,会减小切换信号的次数。It is not difficult to see that the second implementation is more than the first implementation, the number of nodes that the detection unit 704 needs to detect is increased, but the switching unit 705 is selectively outputting the output signal of the first latch 701 or the second latch. When the output signal of 702 is reduced, the number of times of switching signals is reduced.
具体地,在第二种实现方式中,检测单元704可以包括第一检测电路和第二检测电路;第一检测电路用于检测第一检测节点是否处于亚稳态,并基于检测结果向切换单元705发送第一控制信号;第二检测电路用于检测第二检测节点是否处于亚稳态,并基于检测结果向切换单元705发送第二控制信号;其中,控制信号包含第一控制信号和第二控制信号。Specifically, in the second implementation manner, the detecting unit 704 may include a first detecting circuit and a second detecting circuit; the first detecting circuit is configured to detect whether the first detecting node is in metastable state, and based on the detection result to the switching unit 705 is configured to send a first control signal, where the second detecting circuit is configured to detect whether the second detecting node is in a metastable state, and send a second control signal to the switching unit 705 according to the detection result; wherein the control signal includes the first control signal and the second control signal.
其中,第一检测节点可以是第一锁存器701中的任一节点,第二检测节点可以是第二锁存器702中的任一节点。第一控制信号用于指示第一锁存器701是否处于亚稳态的情况,第二控制信号用于指示第二锁存器702是否处于亚稳态的情况。The first detecting node may be any one of the first latches 701, and the second detecting node may be any one of the second latches 702. The first control signal is used to indicate whether the first latch 701 is in a metastable state, and the second control signal is used to indicate whether the second latch 702 is in a metastable state.
在检测单元704采用如上结构时,触发器700的结构可以如图13所示。When the detecting unit 704 adopts the above structure, the structure of the flip-flop 700 can be as shown in FIG.
其中,第一检测电路可以包括:第一反相器,与第一检测节点连接,用于在第一检测节点的电压大于或等于第一阈值时输出低电平,以及在第一检测节点的电压低于第一阈值时输出高电平;第二反相器,与第一检测节点连接,用于在第一检测节点的电压大于或等于第二阈值时输出低电平,以及在第一检测节点的电压低于第二阈值时输出高电平,第二阈值小于第一阈值;第一异或门电路,与第一反相器和第二反相器连接,用于对第一反相器的输出信号和第二反相器的输出信号进行异或操作,并将异或操作的结果作为第一控制信号输出至切换单元。The first detecting circuit may include: a first inverter connected to the first detecting node, configured to output a low level when the voltage of the first detecting node is greater than or equal to the first threshold, and at the first detecting node And outputting a high level when the voltage is lower than the first threshold; the second inverter is connected to the first detecting node, and is configured to output a low level when the voltage of the first detecting node is greater than or equal to the second threshold, and at the first When the voltage of the detecting node is lower than the second threshold, the high level is output, and the second threshold is smaller than the first threshold; the first XOR gate circuit is connected to the first inverter and the second inverter for the first The output signal of the phase converter and the output signal of the second inverter are XORed, and the result of the exclusive OR operation is output as a first control signal to the switching unit.
其中,第二检测电路可以包括:第三反相器,与第二检测节点连接,用于在第二检测节点的电压大于或等于第三阈值时输出低电平,以及在第二检测节点的电压低于第三阈值时输出高电平;第四反相器,与第二检测节点连接,用于在第二检测节点的电压大于或等于第四阈值时输出低电平,以及在第二检测节点的电压低于第四阈值时输出高电平,第四阈值小于第三阈值;第二异或门电路,与第三反相器和第四反相器连接,用于对第三反相器的输出信号和第四反相器的输出信号进行异或操作,并将异或操作的结果作为第二控制信号输出至切换单元。The second detecting circuit may include: a third inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the third threshold, and at the second detecting node Outputting a high level when the voltage is lower than the third threshold; and a fourth inverter connected to the second detecting node, configured to output a low level when the voltage of the second detecting node is greater than or equal to the fourth threshold, and in the second When the voltage of the detecting node is lower than the fourth threshold, the high level is output, and the fourth threshold is smaller than the third threshold; the second exclusive OR circuit is connected with the third inverter and the fourth inverter for the third reverse The output signal of the phase converter and the output signal of the fourth inverter are XORed, and the result of the exclusive OR operation is output as a second control signal to the switching unit.
在第一检测电路和第二检测电路采用如上结构时,该检测单元704的工作原理如下:When the first detecting circuit and the second detecting circuit adopt the above structure, the working principle of the detecting unit 704 is as follows:
若第一检测节点处于亚稳态,当第一检测节点的电平状态变化到小于第一阈值、且大于第二阈值的数值范围时,第一反相器输出高电平,第二反相器输出低电平,第一异或门电路输出高电平。当第一检测节点不处于亚稳态时,第一检测节点稳定在高电平或低电平,第一异或门电路输出低电平。If the first detecting node is in a metastable state, when the level state of the first detecting node changes to a value range smaller than the first threshold and greater than the second threshold, the first inverter outputs a high level, and the second inverting The device outputs a low level, and the first XOR gate outputs a high level. When the first detecting node is not in the metastable state, the first detecting node is stable at a high level or a low level, and the first XOR gate circuit outputs a low level.
若第二检测节点处于亚稳态,当第二检测节点的电平状态变化到小于第三阈值、且大于第四阈值的数值范围时,第三反相器输出高电平,第四反相器输出低电平,第二异或门电路输出高电平。当第二检测节点不处于亚稳态时,第二检测节点稳定在高电平或低电平, 第二异或门电路输出低电平。If the second detecting node is in a metastable state, when the level state of the second detecting node changes to a value range smaller than the third threshold and greater than the fourth threshold, the third inverter outputs a high level, and the fourth inverting The device outputs a low level, and the second XOR gate outputs a high level. When the second detecting node is not in the metastable state, the second detecting node is stable at a high level or a low level, and the second exclusive OR circuit outputs a low level.
因此,检测单元704输出的第一控制信号即可表征第一锁存器701是否处于亚稳态,检测单元704输出的第二控制信号即可表征第二锁存器702是否处于亚稳态,从而使得切换单元705可以在检测单元704输出的第一控制信号和第二控制信号的控制下,选择性地输出第一锁存器701的输出信号或第二锁存器702的输出信号。Therefore, the first control signal outputted by the detecting unit 704 can be used to indicate whether the first latch 701 is in metastable state, and the second control signal outputted by the detecting unit 704 can indicate whether the second latch 702 is in metastable state. Thereby, the switching unit 705 can selectively output the output signal of the first latch 701 or the output signal of the second latch 702 under the control of the first control signal and the second control signal output by the detecting unit 704.
例如,若检测单元704输出至切换单元705的第一控制信号为高电平,则第一锁存器701处于亚稳态,此时切换单元可选择输出第二锁存器702的输出信号,避免将亚稳态传递至下一级的第三锁存器706;之后,切换单元一直选择输出第二锁存器702的输出信号,直至第二控制信号变为高电平,此时,第二锁存器702处于亚稳态,切换单元才选择输出第一锁存器701的输出信号。For example, if the first control signal outputted by the detecting unit 704 to the switching unit 705 is at a high level, the first latch 701 is in a metastable state, and at this time, the switching unit may select to output an output signal of the second latch 702. Avoid transferring the metastable state to the third latch 706 of the next stage; after that, the switching unit always selects and outputs the output signal of the second latch 702 until the second control signal goes high, at this time, The second latch 702 is in a metastable state, and the switching unit selects to output the output signal of the first latch 701.
需要说明的是,以上对检测单元704的结构的介绍仅为一种示例,实际实现时,检测单元704不限于上述结构。比如,第一反相器和第二反相器也可以通过两个阈值不同的电压比较器实现。再比如,第一异或门电路也可以用同或门电路实现。当采用同或门电路实现时,切换单元705在判断输出第一锁存器701的输出信号还是第二锁存器702的输出信号时,与采用异或门电路实现时的判断逻辑相反,具体实现方式此处不再赘述。It should be noted that the above description of the structure of the detecting unit 704 is merely an example. In actual implementation, the detecting unit 704 is not limited to the above structure. For example, the first inverter and the second inverter can also be implemented by two voltage comparators having different threshold values. For another example, the first XOR gate circuit can also be implemented by the same OR gate circuit. When the same OR circuit is used, the switching unit 705 determines the output signal of the first latch 701 or the output signal of the second latch 702, which is opposite to the judgment logic when the XOR gate circuit is implemented. Implementations are not described here.
同样需要说明的是,在第二种实现方式中,第一锁存器701的结构和第二锁存器702的结构可以参照第一种实现方式中的相关描述,此处不再赘述。It should be noted that, in the second implementation manner, the structure of the first latch 701 and the structure of the second latch 702 can refer to related descriptions in the first implementation manner, and details are not described herein again.
综上,在本申请实施例提供的触发器700中,由于第一锁存器701所采用的第二时钟信号和第二锁存器702所采用的第一时钟信号存在相位差,那么,在触发器700中输入的数据信号发生电平翻转的时刻,若正处于第一时钟信号的时间窗口内(即第二锁存器702处于亚稳态),则通常不会处于第二时钟信号的时间窗口内(即第一锁存器701不处于亚稳态)。同样地,触发器700中输入的数据信号发生电平翻转的时刻,若正处于第二时钟信号的时间窗口内(即第一锁存器701处于亚稳态),则通常不会处于第一时钟信号的时间窗口内(即第二锁存器702不处于亚稳态)。因此,第一锁存器701和第二锁存器702不会同时处于亚稳态。In summary, in the flip-flop 700 provided by the embodiment of the present application, since the second clock signal used by the first latch 701 and the first clock signal used by the second latch 702 have a phase difference, then The time at which the data signal input to the flip-flop 700 is level-inverted is normally not in the second clock signal if it is within the time window of the first clock signal (ie, the second latch 702 is metastable). Within the time window (ie, the first latch 701 is not in metastability). Similarly, the time at which the data signal input in the flip-flop 700 is level-inverted is normally not in the first time if it is within the time window of the second clock signal (ie, the first latch 701 is in metastable state). Within the time window of the clock signal (ie, the second latch 702 is not in metastable state). Therefore, the first latch 701 and the second latch 702 are not simultaneously metastable.
触发器700中,在检测单元704检测到第一锁存器701处于亚稳态时,则切换单元705可根据控制信号选择输出第二锁存器702的输出信号;在检测单元704检测到第二锁存器702处于亚稳态时,则切换单元705可根据控制信号选择输出第一锁存器701的输出信号。因此,采用本申请实施例提供的触发器700,可以使得输出至第三锁存器706的输入端的信号处于稳定状态,从而使得触发器700的输出信号处于稳定状态,减小触发器700出现亚稳态现象的概率,从而避免触发器的输出信号出现逻辑误判、影响系统正常工作。In the flip-flop 700, when the detecting unit 704 detects that the first latch 701 is meta-stable, the switching unit 705 can select the output signal of the second latch 702 according to the control signal; the detecting unit 704 detects the first When the two latches 702 are in metastability, the switching unit 705 can select to output an output signal of the first latch 701 according to the control signal. Therefore, with the flip-flop 700 provided by the embodiment of the present application, the signal output to the input end of the third latch 706 can be in a stable state, so that the output signal of the flip-flop 700 is in a stable state, and the trigger 700 is reduced. The probability of steady state phenomenon, thus avoiding the logic misjudgment of the output signal of the trigger and affecting the normal operation of the system.
此外,本申请实施例中,通过触发器700内部的结构,即可实现该触发器700输出信号稳定,避免了采用触发器级联方式消除亚稳态的方案所带来的系统输出延迟的现象,提升了系统性能。尤其在多系统交互过程中,若在多个系统中均采用本申请实施例提供的触发器700,则可以降低每个系统的输出延迟,进而提高多系统交互的性能。In addition, in the embodiment of the present application, the output signal of the flip-flop 700 can be stabilized by the structure inside the flip-flop 700, and the delay of the system output caused by the scheme of eliminating the metastable state by using the flip-flop cascade manner is avoided. , improved system performance. In the multi-system interaction process, if the trigger 700 provided by the embodiment of the present application is used in multiple systems, the output delay of each system can be reduced, thereby improving the performance of multi-system interaction.
基于以上实施例,本申请中还提供一种触发器,该触发器可视为触发器700的一个具体示例。参见图14,该触发器包含主锁存器、副锁存器L、延迟单元以及锁存器H。Based on the above embodiment, a trigger is also provided in the present application, which can be regarded as a specific example of the trigger 700. Referring to FIG. 14, the flip-flop includes a master latch, a sub-latch L, a delay unit, and a latch H.
其中,主锁存器采用的时钟信号为经过延迟单元延迟后得到的时钟信号,副锁存器采 用的时钟信号为未经延迟的时钟信号clk。在主锁存器中,除了包含用于实现数据锁存的两个钟控反相器和一个反相器(两个钟控反相器和一个反相器可组成触发器700中的第一锁存器701或第二锁存器702)之外,还包含一个高阈值反相器、一个低阈值反相器、一个异或门电路以及一个数据选择器。该高阈值反相器和低阈值反相器的输入端均与A点连接。The clock signal used by the master latch is a clock signal obtained by delaying the delay unit, and the clock signal used by the slave latch is an undelayed clock signal clk. In the master latch, in addition to two clocked inverters for implementing data latching and an inverter (two clocked inverters and one inverter can form the first of the flip-flops 700) In addition to the latch 701 or the second latch 702), a high threshold inverter, a low threshold inverter, an exclusive OR gate circuit, and a data selector are included. The inputs of the high threshold inverter and the low threshold inverter are both connected to point A.
其中,高阈值反相器、低阈值反相器、异或门电路的组合可视为触发器700中的检测单元704的一个具体示例;数据选择器可视为触发器700中的切换单元705的一个具体示例;锁存器H可视为触发器700中的第三锁存器706的一个具体示例。Wherein, a combination of a high threshold inverter, a low threshold inverter, and an exclusive OR gate circuit can be regarded as one specific example of the detecting unit 704 in the flip flop 700; the data selector can be regarded as the switching unit 705 in the flip flop 700 A specific example of this; the latch H can be considered as a specific example of the third latch 706 in the flip-flop 700.
图14所示的触发器的工作原理如下:The trigger shown in Figure 14 works as follows:
当主锁存器发生亚稳态时,A节点无法稳定在逻辑0或逻辑1的电平状态,而是徘徊在逻辑0和逻辑1之间的中间电平状态。高阈值反相器在采集到A点的中间电平状态时判断A点为低电平,因此高阈值反相器将低电平反相后输出高电平;低阈值反相器在采集到A点的中间电平状态时判断A点为高电平,因此低阈值反相器将高电平反相后输出低电平。异或门电路对高阈值反相器输出的高电平和低阈值反相器输出的低电平进行异或操作后输出高电平。数据选择器接收到异或门电路输出的高电平后,将输出信号切换到副锁存器,即将副锁存器的输出信号输出至锁存器H。由于主锁存器和副锁存器采用不同的时钟信号,因而A点处于亚稳态时,B点不处于亚稳态,因此,数据选择器输出至锁存器H的信号(副锁存器的输出信号)为稳定信号。When the master latch is metastable, the A node cannot settle to the logic 0 or logic 1 level state, but is at the intermediate level between logic 0 and logic 1. The high threshold inverter determines that point A is low when the intermediate level state of point A is collected, so the high threshold inverter inverts the low level and outputs a high level; the low threshold inverter collects the A When the middle level state of the point is judged, the point A is high, so the low threshold inverter inverts the high level and outputs the low level. The XOR gate circuit outputs a high level after XORing the high level of the high threshold inverter output and the low level of the low threshold inverter output. After receiving the high level of the XOR gate output, the data selector switches the output signal to the sub-latch, that is, outputs the output signal of the sub-latch to the latch H. Since the master latch and the sub-latch use different clock signals, point A is in metastable state, point B is not metastable, therefore, the data selector outputs a signal to latch H (sub latch) The output signal of the device is a stable signal.
主锁存器中,C点的电平状态通过一个钟控反相器反馈至A点。由于C点处于稳态,因此,C点的电平状态反馈至A点后,会使得A点由亚稳态变为稳态。此时,高阈值反相器和低阈值反相器的输出一致(即均为高电平,或者均为低电平),异或门电路输出低电平。数据选择器接收到异或门电路输出的低电平后,将输出信号切换到主锁存器,即将主锁存器的输出信号输出至锁存器H。In the master latch, the level state of point C is fed back to point A through a clocked inverter. Since point C is in a steady state, the level state of point C is fed back to point A, which causes point A to change from metastable to steady state. At this time, the outputs of the high threshold inverter and the low threshold inverter are identical (that is, both are high level, or both are low level), and the XOR gate circuit outputs a low level. After receiving the low level of the XOR gate output, the data selector switches the output signal to the master latch, that is, outputs the output signal of the master latch to the latch H.
也就是说,副锁存器在主锁存器处于亚稳态时暂时代替主锁存器向锁存器H输出信号,在主锁存器的亚稳态消除后,则选择输出主锁存器的输出信号。That is, the sub-latch temporarily outputs a signal to the latch H instead of the master latch when the master latch is in metastability, and selects the output master latch after the meta-stable of the master latch is removed. Output signal of the device.
需要说明的是,图14所示的触发器可视为图7所示的触发器700的一个具体示例,图14所示的触发器中未详尽描述的实现方式可参见图7所示的触发器700中的相关描述。It should be noted that the trigger shown in FIG. 14 can be regarded as a specific example of the trigger 700 shown in FIG. 7. The implementation manner not described in detail in the trigger shown in FIG. 14 can be seen in the trigger shown in FIG. A related description in the device 700.
综上,本申请实施例提供一种触发器。采用本申请实施例提供的触发器,可以减小触发器出现亚稳态现象的概率,避免触发器的输出信号出现逻辑误判、影响系统正常工作。In summary, the embodiment of the present application provides a trigger. By using the trigger provided by the embodiment of the present application, the probability of a metastable phenomenon of the trigger can be reduced, and the output signal of the trigger can be prevented from being logically misjudged and affecting the normal operation of the system.
需要注意的是,在本申请实施例中,切换单元、检测单元、延迟单元和锁存器是通过模块化的方式进行呈现,这是一种功能上的划分方式,但是在实际产品中,这些模块中的两个或多个可以集成在一个模块中实现,本申请实施例的保护范围不应因为划分方式受到限缩。It should be noted that in the embodiment of the present application, the switching unit, the detecting unit, the delay unit, and the latch are presented in a modular manner, which is a functional division manner, but in actual products, these are Two or more of the modules may be integrated into one module, and the protection scope of the embodiment of the present application should not be limited by the division manner.
本发明实施例提供的触发器可以用于各种设备的集成电路中,尤其是涉及高低频模块间的交互电路,比如CPU内核和外围设备的接口电路中。当然,由于本发明实施例提供的触发器本身能降低亚稳态出现的几率,也可以作为基础器件广泛应用到其他的集成电路方案中。The flip-flop provided by the embodiment of the invention can be used in an integrated circuit of various devices, in particular, an interaction circuit between high and low frequency modules, such as an interface circuit of a CPU core and a peripheral device. Of course, since the flip-flop provided by the embodiment of the present invention can reduce the probability of occurrence of metastability, it can also be widely applied as a basic device to other integrated circuit solutions.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.
Claims (13)
- 一种触发器,用于在第一时钟信号的控制下对输入的数据信号进行锁存和输出,其特征在于,包括:第一锁存器、第二锁存器、延迟单元、检测单元、切换单元以及第三锁存器;A flip-flop for latching and outputting an input data signal under control of a first clock signal, comprising: a first latch, a second latch, a delay unit, a detecting unit, Switching unit and third latch;所述延迟单元,用于将所述第一时钟信号延迟预设时间后得到并输出第二时钟信号;The delay unit is configured to delay and output the second clock signal after delaying the first clock signal by a preset time;所述第一锁存器的时钟信号输入端与所述延迟单元连接,以接收所述第二时钟信号;所述第一锁存器用于根据所述第二时钟信号,对所述数据信号进行锁存或输出;a clock signal input end of the first latch is coupled to the delay unit to receive the second clock signal; the first latch is configured to perform the data signal according to the second clock signal Latch or output;所述第二锁存器用于根据所述第一时钟信号,对所述数据信号进行锁存或输出;The second latch is configured to latch or output the data signal according to the first clock signal;所述检测单元用于检测所述第一锁存器或所述第二锁存器是否处于亚稳态,并基于检测结果向所述切换单元发送控制信号;The detecting unit is configured to detect whether the first latch or the second latch is in a metastable state, and send a control signal to the switching unit based on the detection result;所述切换单元用于根据所述控制信号,选择输出所述第一锁存器的输出信号或所述第二锁存器的输出信号;The switching unit is configured to select to output an output signal of the first latch or an output signal of the second latch according to the control signal;所述第三锁存器的数据输入端与所述切换单元的输出端连接,用于根据所述第一时钟信号,对所述切换单元的输出信号进行锁存或输出。The data input end of the third latch is connected to the output end of the switching unit, and is configured to latch or output the output signal of the switching unit according to the first clock signal.
- 如权利要求1所述的触发器,其特征在于,所述切换单元在根据所述控制信号,选择输出所述第一锁存器的输出信号或所述第二锁存器的输出信号时,具体用于:The flip-flop according to claim 1, wherein said switching unit selectively selects an output signal of said first latch or an output signal of said second latch according to said control signal Specifically used for:所述切换单元在所述检测单元确定所述第一锁存器处于亚稳态时,选择输出所述第二锁存器的输出信号;或者The switching unit selects to output an output signal of the second latch when the detecting unit determines that the first latch is in a metastable state; or所述切换单元在所述检测单元确定所述第二锁存器处于亚稳态时,选择输出所述第一锁存器的输出信号。The switching unit selects to output an output signal of the first latch when the detecting unit determines that the second latch is in a metastable state.
- 如权利要求1或2所述的触发器,其特征在于,所述预设时间大于所述第一锁存器的建立时间和保持时间之和,且小于所述第一时钟信号的信号周期。The flip-flop according to claim 1 or 2, wherein the preset time is greater than a sum of a setup time and a hold time of the first latch and less than a signal period of the first clock signal.
- 如权利要求1~3任一项所述的触发器,其特征在于,所述检测单元在检测所述第一锁存器或所述第二锁存器是否处于亚稳态时,具体用于:The flip-flop according to any one of claims 1 to 3, wherein the detecting unit is specifically configured to detect whether the first latch or the second latch is in a metastable state, :所述检测单元检测所述第一锁存器或所述第二锁存器中的检测节点是否处于亚稳态。The detecting unit detects whether the detecting node in the first latch or the second latch is in a metastable state.
- 如权利要求4所述的触发器,其特征在于,所述检测单元包括:The trigger of claim 4, wherein the detecting unit comprises:第一反相器,与所述检测节点连接,用于在所述检测节点的电压大于或等于第一阈值时输出低电平,以及在所述检测节点的电压低于第一阈值时输出高电平;a first inverter connected to the detecting node, configured to output a low level when a voltage of the detecting node is greater than or equal to a first threshold, and a high output when a voltage of the detecting node is lower than a first threshold Level第二反相器,与所述检测节点连接,用于在所述检测节点的电压大于或等于第二阈值时输出低电平,以及在所述检测节点的电压低于第二阈值时输出高电平,所述第二阈值小于所述第一阈值;a second inverter connected to the detecting node, configured to output a low level when a voltage of the detecting node is greater than or equal to a second threshold, and output high when a voltage of the detecting node is lower than a second threshold Level, the second threshold is less than the first threshold;第一异或门电路,与所述第一反相器和所述第二反相器连接,用于对所述第一反相器的输出信号和所述第二反相器的输出信号进行异或操作,并将异或操作的结果作为所述控制信号输出至所述切换单元。a first XOR gate circuit coupled to the first inverter and the second inverter for performing an output signal of the first inverter and an output signal of the second inverter An exclusive OR operation, and outputting the result of the exclusive OR operation as the control signal to the switching unit.
- 如权利要求4或5所述的触发器,其特征在于,所述第一锁存器包括第一钟控反相器、第二钟控反相器和第三反相器;The flip-flop according to claim 4 or 5, wherein the first latch comprises a first clocked inverter, a second clocked inverter, and a third inverter;所述第一钟控反相器的输入端输入所述数据信号,所述第一钟控反相器的输出端作为所述检测节点与所述检测单元连接,且与所述第三反相器的输入端连接;所述第三反相器的输出端输出的信号作为所述第一锁存器的输出信号;所述第二钟控反相器的输入端与所 述第三反相器的输出端连接,所述第二钟控反相器的输出端与所述第一钟控反相器的输出端连接;The input end of the first clocked inverter inputs the data signal, and the output end of the first clocked inverter is connected to the detecting unit as the detecting node, and is in reverse with the third The input end of the third inverter is outputted as an output signal of the first latch; the input end of the second clocked inverter is opposite to the third inversion The output of the second clocked inverter is connected to the output of the first clocked inverter;其中,所述第一钟控反相器和所述第二钟控反相器在所述第二时钟信号下交替导通。The first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
- 如权利要求4或5所述的触发器,其特征在于,所述第一锁存器包括第一钟控反相器、第二钟控反相器和第三反相器;The flip-flop according to claim 4 or 5, wherein the first latch comprises a first clocked inverter, a second clocked inverter, and a third inverter;所述第一钟控反相器的输入端输入所述数据信号,所述第一钟控反相器的输出端作为所述检测节点与所述检测单元连接,且与所述第三反相器的输入端连接;所述第三反相器的输出端输出的信号作为所述第一锁存器的输出信号;所述第二钟控反相器的输入端作为所述第一锁存器的反馈端与所述切换单元的输出端连接,所述第二钟控反相器的输出端与所述第一钟控反相器的输出端连接;The input end of the first clocked inverter inputs the data signal, and the output end of the first clocked inverter is connected to the detecting unit as the detecting node, and is in reverse with the third An input of the third inverter is output as a signal of the first latch; an input of the second clocked inverter is used as the first latch a feedback end of the device is connected to an output end of the switching unit, and an output end of the second clocked inverter is connected to an output end of the first clocked inverter;其中,所述第一钟控反相器和所述第二钟控反相器在所述第二时钟信号下交替导通。The first clocked inverter and the second clocked inverter are alternately turned on under the second clock signal.
- 如权利要求4~7任一项所述的触发器,其特征在于,所述第二锁存器包括第三钟控反相器、第四钟控反相器和第四反相器;The flip-flop according to any one of claims 4 to 7, wherein the second latch comprises a third clocked inverter, a fourth clocked inverter and a fourth inverter;所述第三钟控反相器的输入端输入所述数据信号,所述第三钟控反相器的输出端作为所述检测节点与所述检测单元连接,且与所述第四反相器的输入端连接;所述第四反相器的输出端输出的信号作为所述第二锁存器的输出信号;所述第四钟控反相器的输入端与所述第四反相器的输出端连接,所述第四钟控反相器的输出端与所述第三钟控反相器的输出端连接;An input end of the third clocked inverter inputs the data signal, and an output end of the third clocked inverter is connected to the detecting unit as the detecting node, and is connected to the fourth inversion The input of the fourth inverter is connected to the output of the second inverter as an output signal of the second latch; the input of the fourth clocked inverter and the fourth inverting The output of the fourth clocked inverter is connected to the output of the third clocked inverter;其中,所述第三钟控反相器和所述第四钟控反相器在所述第一时钟信号下交替导通。The third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
- 如权利要求4~7任一项所述的触发器,其特征在于,所述第二锁存器包括第三钟控反相器、第四钟控反相器和第四反相器;The flip-flop according to any one of claims 4 to 7, wherein the second latch comprises a third clocked inverter, a fourth clocked inverter and a fourth inverter;所述第三钟控反相器的输入端输入所述数据信号,所述第三钟控反相器的输出端作为所述检测节点与所述检测单元连接,且与所述第四反相器的输入端连接;所述第四反相器的输出端输出的信号作为所述第二锁存器的输出信号;所述第四钟控反相器的输入端作为所述第二锁存器的反馈端与所述切换单元的输出端连接,所述第四钟控反相器的输出端与所述第三钟控反相器的输出端连接;An input end of the third clocked inverter inputs the data signal, and an output end of the third clocked inverter is connected to the detecting unit as the detecting node, and is connected to the fourth inversion An input of the fourth inverter is output as a signal of the second latch; an input of the fourth clocked inverter serves as the second latch a feedback end of the device is connected to an output end of the switching unit, and an output end of the fourth clocked inverter is connected to an output end of the third clocked inverter;其中,所述第三钟控反相器和所述第四钟控反相器在所述第一时钟信号下交替导通。The third clocked inverter and the fourth clocked inverter are alternately turned on under the first clock signal.
- 如权利要求1~3任一项所述的触发器,其特征在于,所述检测单元在检测所述第一锁存器或所述第二锁存器是否处于亚稳态时,具体用于:The flip-flop according to any one of claims 1 to 3, wherein the detecting unit is specifically configured to detect whether the first latch or the second latch is in a metastable state, :所述检测单元检测所述第一锁存器中的第一检测节点是否处于亚稳态,以及检测所述第二锁存器中的第二检测节点是否处于亚稳态。The detecting unit detects whether the first detecting node in the first latch is metastable, and detects whether the second detecting node in the second latch is in metastable state.
- 如权利要求10所述的触发器,其特征在于,所述检测单元包括第一检测电路和第二检测电路;所述第一检测电路用于检测所述第一检测节点是否处于亚稳态,并基于检测结果向所述切换单元发送第一控制信号;所述第二检测电路用于检测所述第二检测节点是否处于亚稳态,并基于检测结果向所述切换单元发送第二控制信号;The flip-flop according to claim 10, wherein said detecting unit comprises a first detecting circuit and a second detecting circuit; said first detecting circuit is configured to detect whether said first detecting node is in metastable state, And sending a first control signal to the switching unit based on the detection result; the second detecting circuit is configured to detect whether the second detecting node is in a metastable state, and send a second control signal to the switching unit based on the detection result. ;其中,所述控制信号包含所述第一控制信号和所述第二控制信号。The control signal includes the first control signal and the second control signal.
- 如权利要求11所述的触发器,其特征在于,所述第一检测电路包括:The flip-flop according to claim 11, wherein said first detecting circuit comprises:第一反相器,与所述第一检测节点连接,用于在所述第一检测节点的电压大于或等于第一阈值时输出低电平,以及在所述第一检测节点的电压低于第一阈值时输出高电平;a first inverter connected to the first detecting node, configured to output a low level when a voltage of the first detecting node is greater than or equal to a first threshold, and a voltage lower than a voltage at the first detecting node Outputting a high level at the first threshold;第二反相器,与所述第一检测节点连接,用于在所述第一检测节点的电压大于或等于 第二阈值时输出低电平,以及在所述第一检测节点的电压低于第二阈值时输出高电平,所述第二阈值小于所述第一阈值;a second inverter connected to the first detecting node, configured to output a low level when a voltage of the first detecting node is greater than or equal to a second threshold, and a voltage lower than a voltage at the first detecting node a second threshold is outputting a high level, and the second threshold is less than the first threshold;第一异或门电路,与所述第一反相器和所述第二反相器连接,用于对所述第一反相器的输出信号和所述第二反相器的输出信号进行异或操作,并将异或操作的结果作为所述第一控制信号输出至所述切换单元;a first XOR gate circuit coupled to the first inverter and the second inverter for performing an output signal of the first inverter and an output signal of the second inverter XOR operation, and outputting the result of the exclusive OR operation as the first control signal to the switching unit;所述第二检测电路包括:The second detection circuit includes:第三反相器,与所述第二检测节点连接,用于在所述第二检测节点的电压大于或等于第三阈值时输出低电平,以及在所述第二检测节点的电压低于第三阈值时输出高电平;a third inverter connected to the second detecting node, configured to output a low level when a voltage of the second detecting node is greater than or equal to a third threshold, and a voltage lower than a voltage of the second detecting node The third threshold outputs a high level;第四反相器,与所述第二检测节点连接,用于在所述第二检测节点的电压大于或等于第四阈值时输出低电平,以及在所述第二检测节点的电压低于第四阈值时输出高电平,所述第四阈值小于所述第三阈值;a fourth inverter connected to the second detecting node, configured to output a low level when a voltage of the second detecting node is greater than or equal to a fourth threshold, and a voltage lower than a voltage of the second detecting node a fourth threshold is outputting a high level, and the fourth threshold is less than the third threshold;第二异或门电路,与所述第三反相器和所述第四反相器连接,用于对所述第三反相器的输出信号和所述第四反相器的输出信号进行异或操作,并将异或操作的结果作为所述第二控制信号输出至所述切换单元。a second exclusive OR gate circuit coupled to the third inverter and the fourth inverter for performing an output signal of the third inverter and an output signal of the fourth inverter An exclusive OR operation, and outputting the result of the exclusive OR operation as the second control signal to the switching unit.
- 一种集成电路,其特征在于,包括如权利要求1~12任一项所述的触发器。An integrated circuit, comprising the flip-flop according to any one of claims 1 to 12.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810260366.0 | 2018-03-27 | ||
CN201810260366.0A CN110311659B (en) | 2018-03-27 | 2018-03-27 | Trigger and integrated circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019184395A1 true WO2019184395A1 (en) | 2019-10-03 |
Family
ID=68060830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/116241 WO2019184395A1 (en) | 2018-03-27 | 2018-11-19 | Flip-flop and integrated circuit |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110311659B (en) |
WO (1) | WO2019184395A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111262583B (en) * | 2019-12-26 | 2021-01-29 | 普源精电科技股份有限公司 | Metastable state detection device and method and ADC circuit |
CN111262562B (en) * | 2020-03-02 | 2021-08-27 | 上海交通大学 | Metastable state detection circuit |
CN111555754B (en) * | 2020-05-26 | 2023-03-10 | 成都铭科思微电子技术有限责任公司 | Metastable state detection circuit applied to synchronous clock sampling of high-speed analog-to-digital converter |
CN111785309B (en) * | 2020-07-01 | 2021-03-19 | 深圳市芯天下技术有限公司 | Method, circuit, storage medium and terminal for realizing non-flash memory interface circuit |
WO2024065509A1 (en) * | 2022-09-29 | 2024-04-04 | 华为技术有限公司 | Control device, control system, and carrier vehicle |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070236254A1 (en) * | 2006-04-05 | 2007-10-11 | Alcatel | Zero clock delay metastability filtering circuit |
CN101431320A (en) * | 2007-11-08 | 2009-05-13 | 中芯国际集成电路制造(上海)有限公司 | High-stability D trigger structure |
CN104767516A (en) * | 2014-01-06 | 2015-07-08 | 上海华虹集成电路有限责任公司 | Synchronous circuit for asynchronous signals |
CN104796113A (en) * | 2014-01-17 | 2015-07-22 | 苏州芯动科技有限公司 | Metastable state reducing D flip-flop equipment |
CN105406839A (en) * | 2014-08-18 | 2016-03-16 | 中芯国际集成电路制造(上海)有限公司 | Circuit and electronic device |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5020038A (en) * | 1990-01-03 | 1991-05-28 | Motorola, Inc. | Antimetastable state circuit |
US5122694A (en) * | 1990-12-26 | 1992-06-16 | Tektronix, Inc. | Method and electrical circuit for eliminating time jitter caused by metastable conditions in asynchronous logic circuits |
US6072346A (en) * | 1997-12-29 | 2000-06-06 | Metaflow Technologies, Inc. | Metastable protected latch |
US6714612B1 (en) * | 2000-06-08 | 2004-03-30 | Sun Microsystems, Inc. | Method and device for synchronization of phase mismatch in communication systems employing a common clock period |
JP2002300009A (en) * | 2001-04-02 | 2002-10-11 | Hitachi Ltd | D flip-flop circuit device |
US7325021B2 (en) * | 2003-03-14 | 2008-01-29 | Nxp B.V. | VLSI implementation of metastability-based random number generator using delay ladders |
CN2922277Y (en) * | 2005-10-25 | 2007-07-11 | 中兴通讯股份有限公司 | Clock burr testing circuit |
CN102402242A (en) * | 2010-09-10 | 2012-04-04 | 三星半导体(中国)研究开发有限公司 | Clock management unit |
CN103633969B (en) * | 2012-08-20 | 2017-10-31 | 上海华虹集成电路有限责任公司 | asynchronous signal transfer circuit |
CN104535918B (en) * | 2014-12-22 | 2017-03-15 | 中国民航大学 | A kind of cross clock domain lock unit internal constant test circuit and method |
US10630271B2 (en) * | 2016-08-17 | 2020-04-21 | Advanced Micro Devices, Inc. | Self timed data sampler |
US9899992B1 (en) * | 2016-08-17 | 2018-02-20 | Advanced Micro Devices, Inc. | Low power adaptive synchronizer |
US9793894B1 (en) * | 2016-11-18 | 2017-10-17 | Via Alliance Semiconductor Co., Ltd. | Data synchronizer for registering a data signal into a clock domain |
-
2018
- 2018-03-27 CN CN201810260366.0A patent/CN110311659B/en active Active
- 2018-11-19 WO PCT/CN2018/116241 patent/WO2019184395A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070236254A1 (en) * | 2006-04-05 | 2007-10-11 | Alcatel | Zero clock delay metastability filtering circuit |
CN101431320A (en) * | 2007-11-08 | 2009-05-13 | 中芯国际集成电路制造(上海)有限公司 | High-stability D trigger structure |
CN104767516A (en) * | 2014-01-06 | 2015-07-08 | 上海华虹集成电路有限责任公司 | Synchronous circuit for asynchronous signals |
CN104796113A (en) * | 2014-01-17 | 2015-07-22 | 苏州芯动科技有限公司 | Metastable state reducing D flip-flop equipment |
CN105406839A (en) * | 2014-08-18 | 2016-03-16 | 中芯国际集成电路制造(上海)有限公司 | Circuit and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN110311659A (en) | 2019-10-08 |
CN110311659B (en) | 2021-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019184395A1 (en) | Flip-flop and integrated circuit | |
US9092013B2 (en) | Time-to-digital converter | |
US9824731B2 (en) | Data reading circuit | |
US8466727B2 (en) | Protection against fault injections of an electronic circuit with flip-flops | |
US9899992B1 (en) | Low power adaptive synchronizer | |
US8860468B1 (en) | Clock multiplexer | |
US8644439B2 (en) | Circuits and methods for signal transfer between different clock domains | |
CN102361453A (en) | High-speed duty ratio adjustment and double-end-to-single-end circuit for phase-locked loop | |
US5128970A (en) | Non-return to zero synchronizer | |
CN104935345A (en) | System and method for a time-to-digital converter | |
US9112489B2 (en) | Sequential logic circuit and method of providing setup timing violation tolerance therefor | |
US10630271B2 (en) | Self timed data sampler | |
US10547311B2 (en) | Reducing glitches that occur when multiplexing of asynchronous clocks using flip-flops and logic gates | |
US9991876B2 (en) | Master-slave flip-flop | |
US11073862B2 (en) | Synchronization circuit and cascaded synchronization circuit for converting asynchronous signal into synchronous signal | |
CN114679158B (en) | Periodic signal generating device, signal processing system and periodic signal generating method thereof | |
US10014849B2 (en) | Clock detectors and methods of detecting clocks | |
TW202010262A (en) | Synchronous mirror delay circuit and operation method for synchronous mirror delay | |
EP3428768B1 (en) | Robust boot block design and architecture | |
KR102002466B1 (en) | Digital counter | |
US20070234251A1 (en) | Data Output Clock Selection Circuit For Quad-Data Rate Interface | |
US10454457B1 (en) | Self-gating flip-flop | |
CN111030669B (en) | RS latch, RS trigger and controller | |
Al-bayati et al. | Design of a C-element based clock domain crossing interface | |
JP2016213549A (en) | Digital circuit and analog/digital (a/d) conversion circuit and digital signal processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18912859 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18912859 Country of ref document: EP Kind code of ref document: A1 |