A filter circuit and electronic device
By designing a parallel filtering module and a logic integration module, the integration and performance issues of filtering schemes under high-frequency interference are solved, achieving efficient filtering of signal synchronization and bidirectional filtering, which is suitable for scenarios with high integration and high hardware area requirements.
Patent Information
- Application Number
- CN202611506966.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-17
AI Technical Summary
Existing filtering schemes are difficult to achieve in high-frequency interference environments, resulting in simple structure, easy integration, and excellent performance, leading to signal distortion or reduced efficiency, and failing to meet stringent industry standards and functional safety requirements.
The first and second filtering modules work in parallel and collaboratively, combined with logic integration and output feedback modules. Interference from asynchronous digital signals is filtered out by sampling the clock signal edge. D flip-flops and logic gates are used to achieve signal synchronization and bidirectional narrow pulse filtering.
Without increasing hardware overhead, it effectively filters out interference that contains only a single clock sampling edge within the pulse width, ensuring signal integrity. It is suitable for scenarios with high integration and high hardware area requirements.
Smart Images

Figure CN123122499A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of anti-interference circuit design in electronic circuits, and particularly to a filter circuit and electronic device. Background Technology
[0002] With the rapid development of industrial automation, new energy vehicles, smart grids, and high-frequency communication technologies, electronic systems are continuously upgrading towards higher integration, higher power density, and higher frequency, making the electromagnetic environment in which equipment operates increasingly complex. High-frequency ripple from switching power supplies, surge pulses generated by power device switching, conducted interference from the power grid, radiated electromagnetic interference, and crosstalk in board-level circuits can easily couple into signal and power links. This can lead to minor issues like distorted sampling signal accuracy and erroneous control logic triggering, or more serious issues like equipment malfunction and permanent hardware damage. Furthermore, it directly affects the electromagnetic compatibility performance of equipment, making it unable to meet stringent industry standards and functional safety requirements such as IEC 61000 and ISO 26262.
[0003] Existing filtering schemes mainly fall into two categories. One is passive filtering, such as RC filtering and LC filtering. Although this method has a simple structure, it is prone to distorting the useful signal or has a large size, making it difficult to adapt to the design requirements of miniaturization and integration. The other is to use differential transmission, employing forward or backward error correction techniques in the protocol or coding. This method requires additional redundant or feedback information, reducing the efficiency of the channel.
[0004] Currently, in the automotive and industrial automation fields, high-frequency interference is prevalent in strong electromagnetic environments. Therefore, there is an urgent need for a filter circuit and method that is simple in structure, easy to integrate, flexible in adjustment, and has excellent performance as one of the technical means to solve the current problem. Summary of the Invention
[0005] This application proposes a filtering circuit, including a first filtering module configured to receive an input signal, a clock signal, and an enable signal, and to filter out high-level signals in the input signal that include clock sampling edges less than a threshold; a second filtering module configured to receive the input signal, a clock signal, and an enable signal, and to filter out low-level signals in the input signal that include clock sampling edges less than a threshold; a logic integration module configured to be electrically connected to the first and second filtering modules, and to receive the output signals of the first and second filtering modules, and to integrate and output the filtered output signal of the filtering circuit; and an output feedback module, whose first input terminal is electrically connected to the output terminal of the logic integration module, configured to receive the filtered output signal of the filtering circuit, and whose second input terminal is configured to receive the enable signal, and whose output terminal is electrically connected to the control terminal of the second filtering module, forcibly maintaining the second filtering module in a set state, to prevent the second filtering module from generating jump interference when the input signal jumps from low level to high level before the first filtering module completes the determination of whether the high-level duration of the input signal includes continuous threshold clock signal sampling edges.
[0006] Specifically, the filtering circuit proposed in this application includes a first flip-flop, a second flip-flop, and a first AND gate; the output of the first flip-flop is electrically connected to the second input of the first AND gate; the output of the first AND gate is electrically connected to the data input of the second flip-flop; the input signals are respectively input to the data input of the first flip-flop and the first input of the first AND gate; the clock inputs of both the first and second flip-flops receive the clock signal, and their reset terminals both receive the enable signal, and both are reset to the same logic level as the low level of the input signal during the power-on initialization phase; the output of the second flip-flop serves as the output of the first filtering module.
[0007] Specifically, the filtering circuit proposed in this application includes a second filtering module comprising a first inverter, a third flip-flop, a fourth flip-flop, and a second AND gate; the output terminal of the first inverter is electrically connected to the data input terminal of the third flip-flop and the first input terminal of the second AND gate, respectively; the output terminal of the third flip-flop is electrically connected to the second input terminal of the second AND gate; the output terminal of the second AND gate is electrically connected to the data input terminal of the fourth flip-flop; the input terminal of the first inverter receives the input signal, the clock input terminals of the third and fourth flip-flops both receive the clock signal, the set terminal of the third flip-flop receives the enable signal, and both are set to a logic level opposite to the low level of the input signal during the power-on initialization phase; the output terminal of the fourth flip-flop serves as the output terminal of the second filtering module.
[0008] Specifically, the filtering circuit proposed in this application includes a logic integration module comprising a second inverter and a first NAND gate; the input terminal of the second inverter is electrically connected to the output terminal of the first filtering module, and the output terminal of the second inverter is electrically connected to the first input terminal of the first NAND gate; the second input terminal of the first NAND gate is electrically connected to the output terminal of the second filtering module; and the output terminal of the first NAND gate serves as the output terminal of the logic integration module.
[0009] Specifically, the filtering circuit proposed in this application includes an output feedback module comprising a third AND gate; the first input terminal of the third AND gate receives the filtered output signal, and the second input terminal of the third AND gate receives the enable signal; the output terminal of the third AND gate is electrically connected to the set terminal of the fourth flip-flop in the second filtering module; or the output feedback module comprises a third inverter and a second NAND gate; the input terminal of the third inverter is electrically connected to the output terminal of the fourth flip-flop in the second filtering module, and the output terminal of the third inverter is electrically connected to the first input terminal of the second NAND gate; the second input terminal of the second NAND gate receives the filtered output signal; and the output terminal of the second NAND gate is electrically connected to the set terminal of the fourth flip-flop in the second filtering module.
[0010] In particular, the filtering circuit proposed in this application also includes a mode configuration module, configured to receive a configuration signal and, based on the received configuration signal, select an operating mode of using only the first filtering module, using only the second filtering module, or simultaneously disabling both the first filtering module and the second filtering module.
[0011] Specifically, in the filtering circuit proposed in this application, the first flip-flop, the second flip-flop, the third flip-flop, and the fourth flip-flop are D flip-flops.
[0012] This application also proposes another filtering circuit, including a first filtering circuit unit as described in any of the above filtering circuits, configured to receive a first clock signal and an input signal, and electrically connected to a first input terminal of an output unit; a second filtering circuit unit as described in any of the above filtering circuits, configured to receive a second clock signal after the first clock signal has been inverted by an inverter and an input signal, and electrically connected to a second input terminal of an output unit; and an output unit configured to receive the output signals of the first filtering circuit unit and the second filtering circuit unit, and perform logical operations on the two output signals to generate a final output signal.
[0013] In particular, another filtering circuit proposed in this application includes an OR gate as the output unit.
[0014] This application also proposes an electronic device including any of the filtering circuits described above.
[0015] The filtering circuit proposed in this application for harsh electromagnetic environments, particularly for high-frequency interference, can cause transmission errors and packet loss in both serial and parallel communication interfaces. These signals are typically asynchronous, requiring synchronization before processing. This method combines synchronization and filtering circuitry to filter out high-level or low-level interference that consists of only one clock sampling edge across the entire pulse width. Attached Figure Description
[0016] Figure 1 This is a logic diagram of a filter circuit according to an embodiment of the present application; Figure 2 This is a schematic diagram of a filter circuit according to an embodiment of this application; Figure 3 According to Figure 2 A schematic diagram of the working waveform of the filter circuit in the embodiment; Figure 4 This is a schematic diagram of a filter circuit according to another embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] In the following detailed description, reference can be made to the accompanying drawings, which form part of this application and illustrate specific embodiments of the present application. In the drawings, similar reference numerals describe substantially similar components in different figures. Specific embodiments of the present application are described in sufficient detail below to enable those skilled in the art to implement the technical solutions of the present application. It should be understood that other embodiments may also be utilized, or structural, logical, or electrical changes may be made to the embodiments of the present application.
[0019] Techniques, methods, and apparatus known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and apparatus should be considered part of the specification. The lines connecting the units in the accompanying drawings are merely for illustrative purposes, indicating that at least the units at both ends of the line are communicating with each other, and are not intended to prevent unconnected units from communicating. Furthermore, the number of lines between two units is intended to indicate at least the number of signals involved in communication between the two units or at least the number of output terminals, and is not intended to limit communication between the two units to only the signals shown in the figures.
[0020] The filtering circuit proposed in this application is driven by the sampling edge of the clock signal CLK. Through the parallel and collaborative operation of the first filtering module and the second filtering module, the output is updated only when the decision conditions are met for consecutive sampling edges. The clock synchronization processing of asynchronous digital signals and the filtering of bidirectional narrow pulse interference are integrated into the same minimized logic gate structure. With a small increase in hardware overhead, it can completely retain the valid signal when the pulse width of the input signal exceeds the set number of clock cycles, while filtering out interference that contains only a single clock sampling edge within the pulse width. It is suitable for scenarios that are not sensitive to signal output delay but have requirements for reliability and hardware area. It is a circuit design that exchanges a small amount of fixed delay for bidirectional filtering capability with minimal hardware.
[0021] Figure 1 This is a logic diagram of a filter circuit according to an embodiment of the present application.
[0022] According to one embodiment, the filtering circuit of this application includes a first filtering module 101, a second filtering module 102, a logic integration module 103, and an output feedback module 104. According to one embodiment, an input signal IN, a clock signal CLK, and an enable signal EN are respectively input to the input terminals of the first filtering module 101 and the second filtering module 102. The output terminal of the first filtering module 101 is electrically connected to the first input terminal of the logic integration module 103, and the output terminal of the second filtering module 102 is electrically connected to the second input terminal of the logic integration module 103. The output terminal of the logic integration module 103 outputs a filtered output signal OUT. The output signal OUT and the enable signal EN are respectively input to the two input terminals of the output feedback module 104. The output signal of the output feedback module 104 is input as a feedback signal to the control terminal of the second filtering module 102, forming a feedback loop from the output signal OUT to the second filtering module 102.
[0023] According to one embodiment, the first filtering module 101 is used to filter out high-level signals, including clock sampling edges less than a threshold, that appear on a low-level background in the input signal IN.
[0024] According to one embodiment, the second filtering module 102 is used to filter out low-level signals, including clock sampling edges less than a threshold, that appear on a high-level background in the input signal IN.
[0025] According to one embodiment, the logic integration module 103 is used to logically integrate the output signals of the first filtering module 101 and the second filtering module 102, so as to generate a correct filtered output signal OUT under any input state.
[0026] According to one embodiment, the output feedback module 104 is used to perform logical operations on the filtered output signal OUT and the enable signal EN, and electrically connect the output terminal to the control terminal of the second filter module 102 to force the second filter module 102 to be in a set state. This prevents the second filter module 102 from generating transition interference that may change the output signal OUT when the input signal IN transitions from a low level to a high level, before the first filter module 101 has completed the decision on whether the high-level duration of the input signal IN includes the sampling edge of the continuous threshold clock signal CLK.
[0027] According to one embodiment, the output terminal of the output feedback module 104 can also be electrically connected to the control terminal of the first filter module 101 (not shown).
[0028] According to one embodiment, the filtering circuit may further include a mode configuration module (not shown) electrically connected to the first filtering module 101 and the second filtering module 102, which receives a configuration signal and selects an operating mode based on the received configuration signal. The mode may use only the high-level interference filtering function, only the low-level interference filtering function, or disable both filtering functions simultaneously.
[0029] According to one embodiment, the operating frequency of the clock signal CLK can be flexibly configured according to application requirements to achieve dynamic adjustment of the filtering width. Specifically, a higher CLK frequency results in a shorter interval between adjacent sampling edges, leading to a smaller filtering width, suitable for high-speed applications. Conversely, a lower CLK frequency results in a larger filtering width, suitable for low-speed applications.
[0030] Figure 2 This is a schematic diagram of a filter circuit according to an embodiment of the present application.
[0031] According to one embodiment, the sampling edge of the clock signal CLK can be either a rising edge or a falling edge.
[0032] According to one embodiment, the internal structure of the first filtering module 201 can be as follows: Figure 2As shown, the first filtering module 201 may include a first flip-flop DFF1, a second flip-flop DFF2, and a first AND gate AND1. The input signal IN is input to the data input terminal of the first flip-flop DFF1 and the first input terminal of the first AND gate AND1, respectively. The output terminal of the first flip-flop DFF1 is electrically connected to the second input terminal of the first AND gate AND1, and the output terminal of the first AND gate AND1 is electrically connected to the data input terminal of the second flip-flop DFF2. The output terminal of the second flip-flop DFF2 is the output terminal of the first filtering module 201 and is electrically connected to the first input terminal of the logic integration module 203. According to one embodiment, the clock input terminals of the first flip-flop DFF1 and the second flip-flop DFF2 respectively receive a clock signal CLK, and the rising edge of the clock signal CLK drives the data latch. According to one embodiment, the reset terminals of both the first flip-flop DFF1 and the second flip-flop DFF2 receive an enable signal EN. When the enable signal EN is valid, both flip-flops output a low level, wherein the reset is valid when the enable signal EN is low.
[0033] In the above connection relationship, the first flip-flop DFF1 serves as the first-stage sampling register of the first filtering module 201. It latches and outputs the input signal IN at the rising edge of the clock signal CLK. The first AND gate AND1 performs a logical AND operation between the input signal IN and the level output by the first flip-flop DFF1. Its output is only high when the input signal IN is high at the rising edge of the clock signal CLK. Due to the signal delay transmission, the second flip-flop DFF2 serves as the second-stage sampling register. It cannot immediately latch and output the output signal of the first AND gate AND1. Instead, it needs to wait for the next rising edge of the clock signal CLK. At this time, the output signal DFF2_Q is the output state of the first AND gate AND1 at the previous moment and serves as the output of the first filtering module 201.
[0034] According to one embodiment, the internal structure of the second filtering module 202 can be as follows: Figure 2As shown, the second filtering module 202 may include a first inverter INV1, a third flip-flop DFF3, a fourth flip-flop DFF4, and a second AND gate AND2. The input signal IN is electrically connected to the input terminal of the first inverter INV1. The first inverter INV1 inverts the input signal IN and outputs it to the data input terminal of the third flip-flop DFF3 and the first input terminal of the second AND gate AND2. The output terminal of the third flip-flop DFF3 is electrically connected to the second input terminal of the second AND gate AND2. The output terminal of the second AND gate AND2 is electrically connected to the data input terminal of the fourth flip-flop DFF4. The output terminal of the fourth flip-flop DFF4 is the output terminal of the second filtering module 202, which is electrically connected to the second input terminal of the logic integration module 203. According to one embodiment, the clock input terminals of the third flip-flop DFF3 and the fourth flip-flop DFF4 respectively receive the clock signal CLK, and the rising edge of the clock signal CLK drives the data latch. According to one embodiment, the set terminal of the third flip-flop DFF3 receives the enable signal EN, and the set terminal of the fourth flip-flop DFF4 receives the output signal of the output feedback module 204. When the enable signal EN is valid, the third flip-flop DFF3 outputs a high level, and when the output of the output feedback module 204 is valid, the fourth flip-flop DFF4 outputs a high level. Specifically, the third flip-flop DFF3 is set when the enable signal EN is low, and the fourth flip-flop DFF4 is set when the output of the output feedback module 204 is low.
[0035] In the above connection, the first inverter INV1 inverts the input signal IN, serving as the signal preprocessing stage of the second filter module 202. The third flip-flop DFF3, acting as the first-stage sampling register of the second filter module 202, latches and outputs the inverted input signal IN at the rising edge of the clock signal CLK. The second AND gate AND2 performs a logical AND operation between the input signal IN and the level output by the third flip-flop DFF3. The output of the second AND gate AND2 is only high when the input signal IN is low at the rising edge of the clock signal CLK. Due to signal delay, the fourth flip-flop DFF4, acting as the second-stage sampling register, cannot immediately latch and output the output signal of the second AND gate AND2. Instead, it needs to wait for the next rising edge of the clock signal CLK. At this time, the output signal DFF4_Q is the output state of the second AND gate AND2 at the previous moment and serves as the output of the second filter module 202.
[0036] According to one embodiment, the internal structure of the logic integration module 203 can be as follows: Figure 2As shown, the logic integration module 203 may include a second inverter INV2 and a first NAND gate. The input of the second inverter INV2 is electrically connected to the output of the second flip-flop DFF2. The output of the second inverter INV2 is electrically connected to the first input of the first NAND gate. The second input of the first NAND gate is electrically connected to the output of the fourth flip-flop DFF4. The output of the first NAND gate outputs the filtered output signal OUT.
[0037] In this circuit, the second inverter INV2 inverts the output signal DFF2_Q of the first filter module 201 to obtain the signal DFF2_QN. When the input signal IN is a high level including two or more rising edges of the clock signal CLK, the signal DFF2_QN is low and the signal DFF4_Q is low. The output signal OUT of the first NAND gate is a high level including two or more rising edges of the clock signal CLK. When the input signal IN is a low level including two or more rising edges of the clock signal CLK, the signals DFF2_QN and DFF4_Q are high. The output signal OUT of the first NAND gate is a low level including two or more rising edges of the clock signal CLK. The logic integration module 203 realizes the correct decision output of the input signal IN.
[0038] According to one embodiment, the internal structure of the output feedback module 204 can be as follows: Figure 2 As shown, it may include a third AND gate AND3. The two inputs of the third AND gate AND3 receive the output signal OUT and the enable signal EN, respectively, and its output is electrically connected to the set terminal of the fourth flip-flop DFF4.
[0039] The aforementioned connection forms a feedback module controlled by the enable signal EN between the output signal OUT and the set input of the fourth flip-flop DFF4. Specifically, when the output signal OUT is low, the third AND gate AND3 performs a logical AND operation between the output signal OUT and the enable signal EN, sending the low level to the set input of the fourth flip-flop DFF4. This forces the output of the fourth flip-flop DFF4 to remain high, ensuring that even if abnormal high-level interference occurs during the low-level period of the input signal IN, which includes two or more rising edges of the clock signal CLK, the output of the second filter module 202 will not be abnormally pulled down to a low level, thus preventing interference with the normal output of the output signal OUT.
[0040] According to one embodiment, the internal structure of the output feedback module 204 may also include a third inverter and a second NAND gate. The input terminal of the third inverter is electrically connected to the output terminal of the fourth flip-flop DFF4. After inverting the output level of the fourth flip-flop DFF4, the inverted result is sent to the first input terminal of the second NAND gate. The second input terminal of the second NAND gate receives the output signal OUT, and its output terminal is electrically connected to the set terminal of the fourth flip-flop DFF4, thereby constructing a feedback module between the output signal OUT and the set terminal of the fourth flip-flop output signal.
[0041] According to one embodiment, the first flip-flop DFF1, the second flip-flop DFF2, the third flip-flop DFF3, and the fourth flip-flop DFF4 can be D flip-flops.
[0042] According to one embodiment, when the output terminal of the output feedback module 204 is electrically connected to the control terminal of the first filter module 201 (not shown), the first flip-flop DFF1, the second flip-flop DFF2, the third flip-flop DFF3 and the fourth flip-flop DFF4 can be asynchronous reset flip-flops.
[0043] Figure 3 According to Figure 2 A schematic diagram of the working waveform of the filter circuit in the embodiment.
[0044] like Figure 3 The waveform diagram shown illustrates, as Figure 2 The complete working process of the filter circuit shown is illustrated in scenarios with both high-level and low-level interference.
[0045] The clock signal CLK is a stable periodic square wave clock. The enable signal EN is pulled high and maintained at a high level after power-on initialization. The input signal IN has two sources of interference: one is a low-level interference lasting less than one clock cycle, and the other is a high-level interference lasting less than one clock cycle. The following combines... Figure 3 right Figure 2 The changes in the voltage levels at each node are explained.
[0046] During the power-on initialization phase T1, after the filter circuit is powered on, the enable signal EN remains low. The first flip-flop DFF1 and the second flip-flop DFF2 are reset by the low level of the enable signal EN. The signals DFF2_Q and AND1_Q (output of the first AND gate AND1) are low, and DFF2_QN is high. The third flip-flop DFF3 is set to high by the low level of the enable signal EN. The third AND gate AND3 outputs a low level because the enable signal EN is low. The fourth flip-flop DFF4 is set to high, and DFF4_Q is high. During the initialization phase, the input signal IN is low, the output of the first inverter INV1 is high, and the output of the second AND gate AND2 is high. The two inputs of the first NAND gate NAND are DFF2_QN and DFF4_Q, respectively, both of which are high, and the output signal OUT is low. After initialization, the enable signal EN is pulled high, the reset and set terminals of each flip-flop are released, and the filter circuit enters the sampling state driven by the clock signal CLK.
[0047] During the effective high-level transmission establishment phase T2, the input signal IN jumps from low level to high level and remains there. After the filter circuit undergoes a double-edge decision based on the rising edges of two consecutive clock signals CLK, the output signal OUT becomes high level.
[0048] Specifically, on the rising edge of the first clock signal CLK after the input signal IN transitions to a high level, the first flip-flop DFF1 receives the high level of the input signal IN. The two inputs of the first AND gate AND1 receive the input signal IN and the updated high level from the output of the first flip-flop DFF1, respectively. The output of signal AND1_Q then transitions to a high level. At this time, the second flip-flop DFF2 outputs the previous signal AND1_Q, which is low. Therefore, signal DFF2_Q remains low, and signal DFF2_QN remains high. Since the output of the first inverter INV1 becomes low... Therefore, the output signal AND2_Q of the second AND gate AND2 jumps to a low level. When the rising edge of the first clock signal CLK arrives, although the fourth flip-flop DFF4 receives the low level of the signal AND2_Q, the output signal OUT is still low. The output of the third AND gate AND3 is low, making the set input of the fourth flip-flop DFF4 valid. The signal DFF4_Q remains high. The first NAND gate NAND receives the high levels of the signals DFF2_QN and DFF4_Q. The output signal OUT remains low after the rising edge of the first clock signal CLK.
[0049] At the rising edge of the second clock signal CLK after the input signal IN transitions to a high level, the output signal of the first flip-flop DFF1 has been updated to a high level. Both inputs of the first AND gate AND1 are at a high level, and its output signal AND1_Q remains at a high level. At this time, the second flip-flop DFF2 outputs the previous signal AND1_Q, which is at a high level, and the signal DFF2_Q subsequently becomes high. The signal DFF2_QN becomes low, and the signal AND2_Q remains low. The fourth flip-flop DFF4 outputs the previous signal AND2_Q, which is at a low level, and the signal DFF4_Q is updated to a low level. The two inputs of the first NAND gate NAND receive signals DFF2_QN and DFF4_Q, which are both at a low level, and the output signal OUT is high.
[0050] Once a valid high level is correctly transmitted to the output, each node enters a stable transmission state.
[0051] In the low-level interference filtering stage T3, the interference pulse width contains only one rising edge of the clock signal CLK, which needs to be filtered out so that the output signal OUT always remains high.
[0052] Before the rising edge of the clock signal CLK arrives within the low-level interference width, the input signal IN jumps to a low level due to the low-level interference. The output of the first inverter INV1 immediately flips to a high level, and the output signal AND1_Q of the first AND gate AND1 immediately becomes low. When the rising edge of the clock signal CLK arrives within the low-level interference width, the second flip-flop DFF2 receives the low level of the signal AND1_Q, the signal DFF2_Q becomes low, the signal DFF2_QN becomes high, the third flip-flop DFF3 outputs a high level, the two inputs of the second AND gate AND2 are both high, the signal AND2_Q becomes high, the fourth flip-flop DFF4 outputs the level of the signal AND2_Q from the previous moment, which is low, so the signal DFF4_Q remains low. The two inputs of the first NAND gate NAND receive the signals DFF2_QN and DFF4_Q respectively, both of which are low, and the output signal OUT remains high under the low-level interference.
[0053] Because the low-level duration is short, the input signal IN recovers to a high level before the first rising edge of the clock signal CLK arrives within the low-level interference width. The output of the first inverter INV1 becomes low, and the signal AND2_Q continues to output a low level. Therefore, the output signal DFF4_Q of the fourth flip-flop DFF4 remains low. When the second rising edge of the clock signal CLK arrives within the low-level interference width, the second flip-flop DFF2 receives the signal AND1_Q from the previous moment, and the signal DFF2_Q jumps to a high level, while the signal DFF2_QN jumps to a low level. The fourth flip-flop DFF4 receives the signal AND2_Q from the previous moment, and the signal DFF4_Q remains low. The output of the first NAND gate NAND remains high, and the output signal OUT always remains high, thus filtering out the low-level interference.
[0054] In the signal end and low-level state recovery phase T4, the input signal IN changes from high level back to low level, the transmission of the effective level signal ends, and after the filtering circuit undergoes double-edge decision by the rising edges of two consecutive clock signals CLK, the output signal OUT falls back to low level, and the circuit returns to the low-level state.
[0055] Specifically, after the input signal IN returns to a low level, the output of the first inverter INV1 flips to a high level, and the output signal AND1_Q of the first AND gate AND1 goes low. On the rising edge of the first clock signal CLK after the input signal IN returns to a low level, signal AND1_Q remains low, signal DFF2_Q jumps low, signal DFF2_QN jumps high, signal AND2_Q jumps high, and signal DFF4_Q, which is the previous signal AND2_Q, is low. The second... At the rising edge of the clock signal CLK, signal DFF2_Q remains low and signal DFF2_QN remains high. The third flip-flop DFF3 continuously receives a high level, and its output remains high. Signal AND2_Q continuously outputs a high level. After the fourth flip-flop DFF4 is sampled at the rising edge of the clock signal CLK, signal DFF4_Q is updated to a high level. The two input terminals of the first NAND gate receive high levels of signals DFF2_QN and DFF4_Q, respectively. The output signal OUT falls back to a low level, and the circuit returns to a low-level state.
[0056] In the high-level interference filtering stage T5, the high-level interference width contains only one rising edge of the clock signal CLK, which needs to be filtered out so that the output signal OUT always remains at a low level.
[0057] When a high-level interference occurs in the first NAND gate, the input signal IN jumps to a high level, and the signal AND2_Q immediately goes low. However, the duration of this high-level pulse is less than one clock cycle, and the pulse width only covers the rising edge of the clock signal CLK. When the rising edge of the clock signal CLK arrives, the first flip-flop DFF1 receives the high level of the input signal IN, and its output is updated to a high level after the edge is completed. At this time, the two input terminals of the first AND gate AND1 are the current high level of the input signal IN and the high level of the output of the first flip-flop DFF1, respectively. The output of the signal AND1_Q is high. The second flip-flop DFF2 receives the low level of the signal AND1_Q from the previous moment, the signal DFF2_Q remains low, the signal DFF2_QN remains high, and the output of the first filter module 201 does not change. One input of the second AND gate AND2 is at a low level at the rising edge of the first inverter INV1, so the signal AND2_Q remains low. The fourth flip-flop DFF4 receives the low level of the signal AND2_Q, but since the output signal OUT has not yet changed, it remains low. The output of the third AND gate AND3 is low, setting the fourth flip-flop DFF4, and the signal DFF4_Q remains high. The two inputs of the first NAND gate NAND receive high levels of signals DFF2_QN and DFF4_Q respectively, and the output remains low. The output signal OUT remains low and does not change.
[0058] Because the high-level duration is insufficient, the input signal IN falls back to a low level before the next rising edge of the clock signal CLK within the high-level interference width arrives. At this time, the signal AND1_Q jumps to a low level. When the next rising edge of the clock signal CLK within the high-level interference width arrives, the signal AND1_Q remains low. The flip-flop DFF2 receives the low level of the signal AND1_Q from the previous moment and maintains a low level. The signal DFF2_QN remains high. The signal AND2_Q outputs a high level because the output of the first inverter INV1 has recovered to a high level. The fourth flip-flop DFF4 receives the low level of the signal AND2_Q from the previous moment, but because the output signal OUT is low, the output signal DFF4_Q is forced to remain high. The two input terminals of the first NAND gate NAND receive the high levels of the signals DFF2_QN and DFF4_Q respectively. The output signal OUT remains low, and the high-level interference is filtered out.
[0059] In summary, as Figure 3 As shown in the waveform of the output signal OUT, both interferences were completely filtered out and not transmitted to the output signal OUT.
[0060] Figure 4This is a schematic diagram of a filter circuit according to another embodiment of this application.
[0061] In scenarios where clock frequency cannot be increased due to design, manufacturing process, or power consumption limitations, the filter circuit can be expanded into a dual-clock-edge structure to further reduce the requirement for the minimum pulse width of the effective input signal. For example, two sets of... Figure 1 The filter circuit shown has one set that samples the signal using the rising edge of the clock signal and another set that samples it using the falling edge of the clock signal. This allows the filter to remove noise less than one cycle while reducing the minimum pulse width requirement of the input signal to 1.5 clock cycles.
[0062] According to one embodiment, the dual clock edge structure includes three components: a first filter circuit unit 401, a second filter circuit unit 402, and an output unit 403.
[0063] According to one embodiment, the first filter circuit unit 401 and the second filter circuit unit 402 each have the following features: Figure 1 The complete circuit structure of the filter circuit is that each unit contains a first filter module, a second filter module, an output feedback module, and a logic integration module.
[0064] According to one embodiment, the first filter circuit unit 401 receives the clock signal CLK and is triggered by the rising or falling edge of the clock signal CLK. The second filter circuit unit 402 receives the clock signal after the clock signal CLK is inverted by the inverter INV_4. When the first filter circuit unit 401 is triggered by the rising edge of the clock signal CLK, the second filter circuit unit 402 is triggered by the falling edge of the clock signal CLK. When the first filter circuit unit 401 is triggered by the falling edge of the clock signal CLK, the second filter circuit unit 402 is triggered by the rising edge of the clock signal CLK. The input signals IN of the two filter circuit units are the same. After each independently completes the filtering decision, the output results are sent to the output unit 403 respectively. The output unit 403 performs logical operation processing on the two output results and finally generates the output signal OUT.
[0065] According to one embodiment, the first filter circuit unit 401 is triggered by the rising edge of the clock signal CLK, and the interval between two adjacent samplings is one cycle. For a valid pulse, the decision condition must be met at the rising edges of two consecutive clock signals CLK; otherwise, it is determined to be interference and filtered out. The second filter circuit unit 402 is triggered by the falling edge of the clock signal CLK. The decision logic is the same as that of the first filter circuit unit 401, and the sampling interval is also one cycle. However, the sampling time is offset by 0.5 cycles relative to the first filter circuit unit 401.
[0066] The sampling edges of the first filter circuit unit 401 and the second filter circuit unit 402 are staggered on the time axis. Considering the worst case: when the valid pulse is established after a certain sampling edge, if the valid pulse is not found at this sampling edge, it is necessary to wait for 0.5 cycles to be sampled by another unit for the first time to be found, and then it takes 1 cycle of the other unit itself to complete the dual-edge decision. Therefore, the minimum reliable identification pulse width is 0.5 cycles + 1 cycle, that is, 1.5 clock cycles.
[0067] According to one embodiment, the output unit may include an OR gate, wherein its first input terminal is electrically connected to the output terminal of the first filter circuit unit and configured to receive the output signal of the first filter circuit unit, and its second input terminal is electrically connected to the output terminal of the second filter circuit unit and configured to receive the output signal of the second filter circuit unit, and its output terminal serves as the output terminal of the filter circuit.
[0068] The dual-clock-edge structure reduces the minimum reliable identification pulse width of the effective input signal from 2 clock cycles to 1.5 clock cycles without reducing the interference filtering capability. It is especially suitable for high-speed serial or parallel communication interface scenarios where the effective signal pulse width is narrow and the interference pulse width is less than one clock cycle.
[0069] To address the aforementioned issues of high hardware overhead in existing digital filtering circuits and the difficulty in combining signal synchronization and bidirectional pulse filtering within a minimized logic structure, this application proposes a minimized gate-level logic structure that uses a first filtering module and a second filtering module in parallel and in conjunction with an output feedback module and a logic integration module. This structure can simultaneously perform clock synchronization processing of asynchronous signals and bidirectional filtering of high and low level interference with extremely low logic resource consumption, making it suitable for digital integrated circuit design scenarios with high requirements for hardware area and integration density.
[0070] The above embodiments are for illustrative purposes only and are not intended to limit the scope of this application. Those skilled in the art can make various changes and modifications without departing from the scope of this application. Therefore, all equivalent technical solutions should also fall within the scope of this application.
Claims
1. A filter circuit, characterized in that, include: The first filtering module is configured to receive an input signal, a clock signal, and an enable signal, and to filter out high-level signals in the input signal that include clock sampling edges less than a threshold. The second filtering module is configured to receive an input signal, a clock signal, and an enable signal, and to filter out low-level signals in the input signal that include clock sampling edges less than a threshold. as well as, The logic integration module is configured to be electrically connected to the first filtering module and the second filtering module, and to receive the output signals of the first filtering module and the second filtering module, and to integrate and output the filtered output signal of the filtering circuit. The output feedback module has a first input terminal electrically connected to the output terminal of the logic integration module, configured to receive the output signal after filtering by the filtering circuit. The second input terminal is configured to receive an enable signal, and its output terminal is electrically connected to the control terminal of the second filtering module, forcibly maintaining the second filtering module in a set state to prevent the second filtering module from generating jump interference when the input signal jumps from low level to high level before the first filtering module completes its decision on whether the high-level duration of the input signal includes the sampling edge of the continuous threshold clock signal.
2. The filter circuit according to claim 1, characterized in that, The first filtering module includes a first flip-flop, a second flip-flop, and a first AND gate; the output of the first flip-flop is electrically connected to the second input of the first AND gate; the output of the first AND gate is electrically connected to the data input of the second flip-flop; the input signals are respectively input to the data input of the first flip-flop and the first input of the first AND gate; the clock inputs of both the first and second flip-flops receive the clock signal, and their reset inputs receive the enable signal, and both are reset to the same logic level as the low level of the input signal during the power-on initialization phase; the output of the second flip-flop serves as the output of the first filtering module.
3. The filter circuit according to claim 2, characterized in that, The second filtering module includes a first inverter, a third flip-flop, a fourth flip-flop, and a second AND gate. The output of the first inverter is electrically connected to the data input of the third flip-flop and the first input of the second AND gate, respectively. The output of the third flip-flop is electrically connected to the second input of the second AND gate. The output of the second AND gate is electrically connected to the data input of the fourth flip-flop. The input of the first inverter receives the input signal, and the clock inputs of both the third and fourth flip-flops receive the clock signal. The set input of the third flip-flop receives the enable signal and is set to a logic level opposite to the low level of the input signal during the power-on initialization phase. The output of the fourth flip-flop serves as the output of the second filtering module.
4. The filter circuit according to claim 3, characterized in that, The logic integration module includes a second inverter and a first NAND gate; the input terminal of the second inverter is electrically connected to the output terminal of the first filter module, and the output terminal of the second inverter is electrically connected to the first input terminal of the first NAND gate; the second input terminal of the first NAND gate is electrically connected to the output terminal of the second filter module; the output terminal of the first NAND gate serves as the output terminal of the logic integration module.
5. The filter circuit according to claim 4, characterized in that, The output feedback module includes a third AND gate; the first input of the third AND gate receives the filtered output signal, and the second input of the third AND gate receives the enable signal; the output of the third AND gate is electrically connected to the set input of the fourth flip-flop in the second filtering module; or, The output feedback module includes a third inverter and a second NAND gate; the input terminal of the third inverter is electrically connected to the output terminal of the fourth flip-flop in the second filtering module, and the output terminal of the third inverter is electrically connected to the first input terminal of the second NAND gate; the second input terminal of the second NAND gate receives the filtered output signal; the output terminal of the second NAND gate is electrically connected to the set terminal of the fourth flip-flop in the second filtering module.
6. The filter circuit according to claim 1, characterized in that, It also includes a mode configuration module, configured to receive a configuration signal and, based on the received configuration signal, select a working mode to use only the first filtering module, or only the second filtering module, or to disable both the first filtering module and the second filtering module simultaneously.
7. The filter circuit according to claim 5, characterized in that, The first, second, third, and fourth flip-flops are D flip-flops.
8. A filter circuit, characterized in that, include: The first filter circuit unit of the filter circuit as described in any one of claims 1-7 is configured to receive a first clock signal and an input signal, and is electrically connected to the first input terminal of the output unit; The second filter circuit unit of the filter circuit as described in any one of claims 1-7 is configured to receive a second clock signal after the first clock signal has been inverted by an inverter and an input signal, and is electrically connected to the second input terminal of the output unit; The output unit is configured to receive the output signals of the first filter circuit unit and the second filter circuit unit, and perform logical operations on the two output signals to generate the final output signal.
9. The filter circuit according to claim 8, characterized in that, The output unit includes an OR gate, whose first input terminal is electrically connected to the output terminal of the first filter circuit unit and configured to receive the output signal of the first filter circuit unit, and whose second input terminal is electrically connected to the output terminal of the second filter circuit unit and configured to receive the output signal of the second filter circuit unit, and whose output terminal serves as the output terminal of the filter circuit.
10. An electronic device, characterized in that, Includes the filter circuit described in any one of claims 1-9.
