WO2024021360A1 - Counter - Google Patents

Counter Download PDF

Info

Publication number
WO2024021360A1
WO2024021360A1 PCT/CN2022/130232 CN2022130232W WO2024021360A1 WO 2024021360 A1 WO2024021360 A1 WO 2024021360A1 CN 2022130232 W CN2022130232 W CN 2022130232W WO 2024021360 A1 WO2024021360 A1 WO 2024021360A1
Authority
WO
WIPO (PCT)
Prior art keywords
counter
sub
counting
signal
clock
Prior art date
Application number
PCT/CN2022/130232
Other languages
French (fr)
Chinese (zh)
Inventor
严波
方超敏
王悦
Original Assignee
普源精电科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 普源精电科技股份有限公司 filed Critical 普源精电科技股份有限公司
Publication of WO2024021360A1 publication Critical patent/WO2024021360A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K23/00Pulse counters comprising counting chains; Frequency dividers comprising counting chains
    • H03K23/40Gating or clocking signals applied to all stages, i.e. synchronous counters

Definitions

  • the invention relates to the technical field of circuits and systems, and in particular to a counter.
  • the counter is a commonly used sequential logic circuit and an important part of digital circuits. Its most basic function is to count by counting the number of clock pulses.
  • the counter uses the AND gate to generate carry. As the number of digits in the counter increases, the inputs of the AND gate will increase one level at a time. When the input of the AND gate exceeds a certain level, the AND operation has to be performed hierarchically, that is, the first few data are ANDed first, and the result of the operation then enters the new AND gate for the next level operation. However, this will cause the propagation delay of the carry signal to increase, and when the number of AND gate levels increases to the point where the propagation delay of the carry signal becomes comparable to the clock cycle, the speed of the counter reaches its limit. It can be seen that the higher the number of digits in the traditional counter structure, the slower the speed; this becomes the biggest limitation of high-speed counters. In addition, propagation delays can easily cause counting errors.
  • embodiments of the present application provide a counter to solve at least one problem existing in the background art.
  • An embodiment of the present application provides a counter, including:
  • a counting module includes a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters in the plurality of sub-counters; wherein the sub-counters are used to count the number of clock pulses. Count to output a count output signal and a carry output signal; the delay unit is used to receive the carry output signal of the previous sub-counter in the at least two sub-counters, and delay the received carry output signal before outputting it to The next level sub-counter;
  • a data alignment module configured to receive counting output signals of multiple sub-counters, and align the received multiple counting output signals belonging to the same counting cycle according to the relationship corresponding to the delay time caused by the delay unit. Data alignment to output count results.
  • a delay unit is provided between every two adjacent levels of sub-counters in the plurality of sub-counters.
  • the delay unit includes a flip-flop, which uses a clock pulse as a control signal to receive the carry output signal of the previous stage sub-counter and output the delayed carry output signal to the The next level sub-counter.
  • At least one of the sub-counters is an n-bit (n-bit) counter, where n is greater than 1; a carry signal is generated between each bit in the n-bit counter through an AND gate;
  • the input end of at least one AND gate in the n-bit counter is connected to the input end of the previous one-bit AND gate;
  • the n-bit counter including no more than one AND gate adopts the following connection method: the input end of the AND gate of this bit is connected to the output end of the previous bit AND gate.
  • the data alignment module includes a trigger, and the data alignment module performs data alignment based on the trigger.
  • the sub-counter is an n-bit counter, where n is greater than or equal to 1; each bit in the n-bit counter includes a first flip-flop; the first flip-flop The device includes a counting input terminal and a counting output terminal; the counting output signal includes a signal of the counting input terminal and/or a signal of the counting output terminal;
  • the delay unit includes at least one second flip-flop; the second flip-flop uses a clock pulse as a control signal to receive the carry output signal of the previous sub-counter and output the delayed carry output signal to the subsequent sub-counter.
  • Level sub counter uses a clock pulse as a control signal to receive the carry output signal of the previous sub-counter and output the delayed carry output signal to the subsequent sub-counter.
  • the data alignment module includes at least one third flip-flop, and the data alignment module performs data alignment based on the third flip-flop;
  • the data alignment module includes a plurality of lines corresponding to a plurality of the sub-counters, and each line in the plurality of lines receives a counting output signal of a corresponding sub-counter;
  • the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line.
  • the number of second flip-flops to the last sub-counter is equal;
  • the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line.
  • the number of second flip-flops to the last sub-counter is incremented by one.
  • the counting output signal received by the line corresponding to the last stage sub-counter in the counting module among the plurality of lines is the signal of the counting input terminal.
  • the counting output signal includes a signal of the counting input terminal and a signal of the counting output terminal; among the plurality of lines, other lines except the line corresponding to the last stage sub-counter , the received counting output signal is the signal at the counting output terminal.
  • it also includes a clock module
  • the clock module is used to generate a first clock signal and a second clock signal, the counting module operates based on the first clock signal, and the data alignment module operates based on the second clock signal.
  • the clock module includes a clock signal input end and a first clock generation line and a second clock generation line connected to the clock signal input end; the first clock generation line is used to generate the clock signal based on the clock signal input end.
  • the clock signal input to the clock signal input terminal generates the first clock signal; the second clock generation circuit is used to generate the second clock signal based on the clock signal input to the clock signal input terminal; the first clock A delay unit is connected to the generation line and/or the second clock generation line.
  • At least two delay units are respectively connected to the first clock generation line and the second clock generation line, and the delay unit located at the later stage has a fan-out capacity greater than that at the previous stage.
  • the fan-out capability of the delay unit is not limited to the delay unit.
  • the counter provided by the embodiment of the present application is provided with a delay unit between at least two adjacent sub-counters among the plurality of sub-counters.
  • the delay unit is used to receive the carry output signal of the previous sub-counter in at least two sub-counters, and Delay the received carry output signal and output it to the subsequent sub-counter; further receive the count output signals of multiple sub-counters through the data alignment module, and according to the relationship corresponding to the delay time caused by the delay unit, the received carry output signal belongs to the same Multiple counting output signals in one counting cycle are data aligned, and the counting result is finally output; in this way, the problem of the propagation delay of the carry signal in the traditional counter structure that limits the counting accuracy and operating speed is solved, while ensuring the counting accuracy. Under the premise, the running speed of the counter is improved, which is conducive to realizing a higher-digit counter.
  • Figure 1 is a schematic structural diagram of a counter provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a counting module in an embodiment of the present application.
  • Figure 3 is a schematic structural diagram of neutron counting according to an embodiment of the present application.
  • Figure 4 is a schematic structural diagram of a data alignment module in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a clock module in an embodiment of the present application.
  • Figure 6 is a schematic structural diagram of a counter provided in a specific example of this application.
  • first, second, etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element.
  • a first resistor may be referred to as a second resistor, and similarly, the second resistor may be referred to as a first resistor, without departing from the scope of the present application.
  • the first resistor and the second resistor are both resistors, but they are not the same resistor.
  • the counter provided by the embodiment of the present application includes a counting module and a data alignment module.
  • the counting module includes a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters in the plurality of sub-counters.
  • Figure 1 shows an example in which the counting module includes a first sub-counter, a second sub-counter... an N-th sub-counter, and a first delay unit and a second delay unit.
  • the number of sub-counters in the embodiment of the present application can be large enough to achieve a larger number of counts.
  • the number of sub-counters can be dozens, hundreds or more; this application does not specify this. limit.
  • the improved technical solution proposed in this application is at least applicable to counters with no less than two sub-counters (that is, N can be more than two).
  • each sub-counter includes a carry input terminal CI and a carry output terminal CO; the cascade connection of each sub-counter means that the carry output terminal CO of the sub-counter located at the previous stage is coupled to the sub-counter located at the subsequent stage.
  • the carry input terminal CI of the counter Therefore, the sub-counter located at the previous stage outputs a carry output signal through the carry output terminal CO, and the carry output signal is transmitted as the input of the sub-counter located at the subsequent stage to the carry input terminal CI of the sub-counter at the subsequent stage, To participate in the counting operation of the subsequent sub-counter.
  • “coupling” in the context of this application means that the coupled end and the coupled end have mutual transmission of electrical signals or data, which can be understood as “electrical connection”, “communication connection”, etc.
  • each sub-counter also includes a clock signal input terminal and a counting output terminal.
  • the clock signal input end can refer to the end of each sub-counter connected to CLOCK1 in Figure 1 or the end of the sub-counter connected to CLOCK in Figure 3.
  • Each sub-counter receives a clock signal through a clock signal input terminal.
  • the clock signal is specifically in the form of a clock pulse.
  • the sub-counter is used to count the number of clock pulses to output a count output signal and a carry output signal.
  • the output count output signal changes once. Specifically, the count changes from 0000, 0001, 0010, 0011... to 1111, and a total of 16 results (the number of clock pulses) can be output From 0 to 15), the signals output by these 16 results through high level representing 1 and low level representing 0 are the counting output signals. After the counting result reaches 1111, the clock pulse increases by one again, which obviously exceeds the maximum value that can be represented by the current 4 bits. At this time, a carry is required, that is, the carry output is 1, and the counting result becomes 0000; understandably, in binary , 10000 means 16, that is, the number of clock pulses changes from 0 to 16. Carry output 1 is specifically reflected in a change in the level of the carry output signal.
  • the count output signal represents the signal corresponding to the specific result of the counter counting the number of clock pulses;
  • the carry output signal represents the signal that is output when the counter reaches the maximum count value and the clock pulse increases again, and the count result requires a carry. signal of.
  • the carry input terminal CI is used to output the carry output signal;
  • the count output terminal is used to output the count output signal.
  • the counting output can refer to D1, D2...DN in Figure 1, or DA ⁇ 0> to DA ⁇ 3> and/or DS ⁇ 0> to DS ⁇ 3> in Figure 3; in the following, DA ⁇ 0> to DA ⁇ 3> will be represented by DA ⁇ 3:0>, and from DS ⁇ 0> to DS ⁇ 3> will be represented by DS ⁇ 3:0>; obviously, DA ⁇ 3:0> and/or DS in Figure 1 ⁇ 3:0> corresponds to D1 in Figure 1. Of course, D2 to DN in Figure 1 can also be the same or similar to D1.
  • the delay unit is configured to receive a carry output signal of a previous sub-counter in at least two sub-counters, delay the received carry output signal and then output it to a subsequent sub-counter.
  • the first delay unit receives the carry output signal of the first sub-counter, delays the received carry output signal, and then outputs it to the second sub-counter.
  • Figure 1 shows the situation where a delay unit is provided between each two adjacent sub-counters in multiple sub-counters; in specific applications, this arrangement can be used to make the components of the entire counting module periodically , thus having a simple structure, high operational stability, and greatly avoiding the impact of the propagation delay of the carry signal.
  • the number and location of delay units can also be selected based on actual needs.
  • a delay unit is provided at least between a pair of two adjacent sub-counters, thereby reducing, at least to a certain extent, the impact of the carry signal propagation delay caused by the AND gate operation on the number and accuracy of the counters.
  • the delay unit can cause the carry output signal of the previous sub-counter to be transmitted to the subsequent sub-counter after a delay of an exact duration or an exact period, so that the subsequent sub-counter can participate in counting at an exact duration or exact period. operation; in other words, the delay made by the delay unit to the carry output signal means that compared with the carry output signal being directly transmitted to the subsequent sub-counter, the carry output signal is transmitted to the subsequent sub-counter at a later time.
  • the exact duration or exact period can be controlled through the delay unit, there is almost no delay when the carry output signal is transmitted to the subsequent sub-counter compared with the clock signal, thereby avoiding the delay caused by the AND gate operation.
  • the data alignment module is used to receive the counting output signals of multiple sub-counters and align the received multiple counting output signals belonging to the same counting cycle according to the relationship corresponding to the delay time caused by the delay unit to output the counting results. .
  • the first sub-counter transmits the counting output signal (such as DS ⁇ 3:0>) to the data alignment module; due to the existence of the first delay unit, the second sub-counter needs to transfer the count output signal at the second moment. Its counting output signal (such as DS ⁇ 7:4>) is transmitted to the data alignment module. It can be seen that the delay time caused by the first delay unit causes the gap between the second moment and the first moment; similarly, if the second sub-counter The carry output signal is output to the third sub-counter (not shown in Figure 1) after passing through the second delay unit.
  • the counting output signal such as DS ⁇ 3:0>
  • the third sub-counter needs to count the output signal at the third moment (such as DS ⁇ 11:8>)
  • the third time is later than the second time by the delay time caused by the second delay unit, and the third time is later than the first time by the delay time caused by the first delay unit and the second delay unit.
  • the data alignment module will receive the counting output signals DS ⁇ 3:0>, DS ⁇ 7:4> and DS ⁇ 11:8> of each sub-counter at different times.
  • the data alignment module is configured to time-align DS ⁇ 3:0> and DS ⁇ 7 according to the relationship corresponding to the delay time caused by the delay unit. :4> and DS ⁇ 11:8> are aligned to output the counting result.
  • the corresponding relationship is as follows: DS ⁇ 3:0> is earlier than DS ⁇ 11:8> due to the delay time caused by the first delay unit and the second delay unit, DS ⁇ 7:4> is earlier than DS ⁇ 11:8 >The delay time caused by the second delay unit is earlier.
  • the embodiment of the present application sets a delay unit between at least two adjacent sub-counters among the plurality of sub-counters.
  • the delay unit is used to receive the carry output signal of the previous sub-counter in at least two sub-counters, and The received carry output signal is delayed and output to the subsequent sub-counter; further, the count output signals of multiple sub-counters are received through the data alignment module, and the received ones belong to the same one according to the relationship corresponding to the delay time caused by the delay unit.
  • Multiple counting output signals of the counting cycle are data aligned, and the counting result is finally output; thus solving the problem that the propagation delay of the carry signal in the traditional counter structure limits the counting accuracy and operating speed, while ensuring the counting accuracy. , which improves the running speed of the counter and is conducive to the realization of higher-digit counters.
  • the delay unit includes a flip-flop, which uses clock pulses as control signals to receive the carry output signal of the previous stage sub-counter and output the delayed carry output signal to the subsequent stage sub-counter.
  • the flip-flop can provide a delay of an integer period, and as a commonly used circuit element in counters, it can simplify the device structure and achieve a stable and reliable delay effect.
  • the specific selection of the delay unit in this application is not limited to this.
  • Other components that can delay the carry output signal of the previous sub-counter can also be applied here, such as programmable delay modules.
  • FIG. 2 shows a schematic structural diagram of a specific counting module.
  • the counting module includes a plurality of cascaded sub-counters and a flip-flop connected between each two adjacent levels of sub-counters.
  • the flip-flop includes a clock signal input terminal, a D terminal that receives a data signal, and a Q terminal that outputs a delayed data signal.
  • the clock signal input end of the flip-flop can refer to the end connected to CLOCK1 in the figure.
  • the flip-flop receives the clock signal through the clock signal input end.
  • the clock signal is specifically in the form of a clock pulse.
  • the flip-flop uses the clock pulse as the control signal to start from a stable state. flip to another stable state.
  • the clock signal input terminal of the flip-flop and the clock signal input terminal of each sub-counter are connected to the same clock signal (CLOCK1 in the figure), and thus work under the control of the same clock signal.
  • the D terminal of the flip-flop is connected to the carry output terminal of the previous sub-counter (the carry output terminal refers to CO0 and CO1 in the figure), thereby receiving the carry output signal of the previous sub-counter;
  • the Q terminal of the flip-flop is connected to the carry output terminal of the subsequent sub-counter.
  • the carry input terminal of the counter is connected to output the delayed carry output signal to the subsequent sub-counter.
  • the flip-flop can be directly connected to the previous-level sub-counter and the subsequent-level sub-counter, that is, no other components other than wires are included therebetween.
  • the flip-flop serving as the delay unit may also be referred to as the "second flip-flop".
  • the second flip-flop may be a D flip-flop.
  • the present application is not limited to this. In other embodiments, other delay circuits may also be used.
  • Figure 3 shows a schematic structural diagram of a sub-counter.
  • the sub-counter includes a flip-flop, an XOR gate and an AND gate; for ease of distinction, in the following description, the flip-flop in the sub-counter may also be called the "first flip-flop”.
  • the sub-counter is a 4-bit counter, including 4 groups of periodically arranged flip-flops, XOR gates and AND gates, and each group of flip-flops, XOR gates and AND gates corresponds to one bit in the 4-bit counter.
  • CI is the carry input terminal
  • CO is the carry output terminal
  • DS in each bit is the counting output terminal of the bit
  • DA is the counting input terminal of the bit. Since the signal of DS is output after a flip-flop delay compared with DA, the signal at DS is usually one clock cycle later than the signal at DA.
  • the counting result at DA can also be called the counter output minus 1.
  • the carry input terminal CI may not be connected to a signal, such as being left vacant; as the last-stage sub-counter in the counting module, its carry output terminal CO may not be coupled to other sub-counters, such as Vacant; in addition, the carry input terminal CI of the sub-counter cascaded in the middle of the counting module is used to receive the output signal of the carry output terminal CO of the previous sub-counter, and its carry output terminal CO is used to transfer the output signal It is transmitted to the carry input terminal CI of the subsequent sub-counter.
  • the XOR gate has two input terminals, one of which is connected to the Q terminal of the flip-flop in the same group (or the same bit), and the other input terminal is connected to the AND in the previous group (or the previous bit).
  • the output of the gate is connected.
  • the two input terminals corresponding to the XOR gate receive the same input signal. If both receive a high level 1, or both receive a low level 0, then the output terminal of the XOR gate outputs a low level 0;
  • the two input terminals corresponding to the XOR gate receive different input signals. If they receive a high level 1 and a low level 0 respectively, the output terminal of the XOR gate outputs a high level 1.
  • the output terminal of the XOR gate is connected to the D terminal of the first flip-flop.
  • An AND gate consists of multiple inputs and an output. A carry signal is generated between each bit in the sub-counter through an AND gate. If multiple input terminals corresponding to the AND gate all receive high-level 1, then the output terminal of the AND gate outputs a high-level 1; otherwise, the output terminal of the AND gate outputs a low-level 0. As mentioned before, the output of the AND gate is connected to the input of the XOR gate in the next group (or last bit). One input terminal of the AND gate is connected to the Q terminal of the flip-flop in the same group; other input terminals of the AND gate may have different connection methods depending on the number of bits in which the AND gate is located.
  • the input terminal of the AND gate located in the first group (or first bit) of the sub-counter is connected to the carry input terminal CI of the sub-counter.
  • the input terminals of the AND gates located in the second group (or second bit) and the third group (or third bit) of the sub-counter are connected to the input end of the AND gate in the previous bit.
  • the input terminal of the AND gate located in the fourth group (or fourth bit) of the sub-counter is connected to the output terminal of the previous AND gate. It can be understood that whether it is connected to all the input terminals of the previous AND gate or to the output terminal of the previous AND gate, based on the working principle of the AND gate, the output result is the same.
  • the signal does not need to go through the AND gate of the previous bit for AND operation, but is only transmitted through the wire, with almost no propagation delay; conversely, if it is connected to the AND gate of the previous bit If the output of the AND gate is connected, the AND operation needs to be performed through the previous AND gate, which will increase the propagation delay due to the AND gate.
  • Figure 3 shows a 4-bit counter as an example, it can be understood that as the number of bits in the counter increases, the number of inputs to the AND gate will increase. However, the number of input terminals of the AND gate is limited and cannot be increased infinitely.
  • the AND operation has to be performed hierarchically. That is, just like the AND gate in the fourth bit in Figure 3, the previous bit AND gate performs an AND operation on the previous bits of data, and the result of the operation is then output to the fourth bit AND gate for the next level operation.
  • At least one sub-counter is an n-bit (n-bit) counter, where n is greater than 1; a carry signal is generated between each bit in the n-bit counter through an AND gate; at least one of the n-bit counters The input end of the AND gate of one bit is connected to the input end of the AND gate of the previous bit; the n-bit counter including no more than one AND gate adopts the following connection method: the input end of the AND gate of this bit is connected to the input end of the previous bit AND gate. Connect to the output of the AND gate.
  • n is less than or equal to 6.
  • the sub-counter can be a 4-bit counter or a 3-bit counter.
  • the sub-counter may include and only include one AND gate connected using the following connection method: the input end of the AND gate of this bit is connected to the output end of the AND gate of the previous bit; or, it may not exceed the number of connections using the following connection method.
  • AND gate The input end of the AND gate of this bit is connected to the output end of the AND gate of the previous bit.
  • Figure 4 shows a schematic structural diagram of a data alignment module.
  • the data alignment module includes a counting output signal receiving end, a clock signal input end, and a counting result output end.
  • DA1-N and DS1-N in the figure for the counting output signal receiving end; the structure shown in the figure does not mean that there are two counting output signal receiving ends of the data alignment module.
  • the counting output signal receiving end There can be more than one; and, the counting output signal receiving end can receive both DA1-N and DS1-N signals, or only DA1-N or DS1-N signals, and can also receive part of DA1-N. signals as well as receiving signals from parts of the DS1-N.
  • DA1-N and DS1-N can be understood in conjunction with Figure 2 and Figure 3; taking DA1 as an example, it represents the counting input end of the first-level sub-counter (n bit counter) in Figure 2, corresponding to Figure 3 DA ⁇ 3:0>; Similarly, DS1 represents the counting output terminal of the first-level sub-counter in Figure 2, corresponding to DS ⁇ 3:0> in Figure 3.
  • DA1-N means from DA1 to DAN; similarly, DS1-N means from DS1 to DSN.
  • CLOCK2 For the clock signal input end of the data alignment module, please refer to CLOCK2 in Figure 4.
  • CLOCK2 and CLOCK1 can be clock synchronized or have phase differences.
  • the counting result output terminal of the data alignment module please refer to DOUT in Figure 4.
  • the counting result output terminal is configured to output the counting result.
  • the data alignment module includes a flip-flop, and the data alignment module performs data alignment based on the flip-flop.
  • the sub-counter is an n-bit counter, where n is greater than or equal to 1; each bit in the n-bit counter includes a first flip-flop; the first flip-flop includes a counting input terminal and counting output terminal; the counting output signal includes the signal of the counting input terminal and/or the signal of the counting output terminal; the delay unit includes at least one second flip-flop; the second flip-flop uses the clock pulse as the control signal to receive the previous stage sub-counter The carry output signal and the delayed carry output signal are output to the subsequent sub-counter; the data alignment module includes at least one third flip-flop, and the data alignment module performs data alignment based on the third flip-flop; the data alignment module includes and multiple sub-counters Corresponding multiple lines, each line in the multiple lines receives the counting output signal of the corresponding sub-counter; for the line in which the received counting output signal is the signal of the counting output terminal, the cascaded third line on the line The number of three flip-flops is equal to the number of second flip-flops in
  • Figure 6 shows a cascade of four sub-counters as an example, and each sub-counter uses a 4-bit counter, thereby realizing a 16-bit counter.
  • 4 4-bit counters are divided into 4-level pipeline structure; therefore, the counting module can also be called "pipeline counter core".
  • the pipeline counter core may include multiple n-bit counters; the number of bits in each sub-counter may be the same or different.
  • the carry output signals of the first-level sub-counter are snapped together by a flip-flop and enter the second-level pipeline to participate in the counting operation.
  • the carry output signal of the second-level sub-counter passes through a flip-flop and then participates in the third-level operation, and so on.
  • each sub-counter generates 4 bits of DA and DS. It can be known that when the carry output signal of the first-level sub-counter is generated, it takes one clock cycle before it participates in the second-level operation. After the carry output signal passes through the second stage of pipeline processing, it passes through a flip-flop before entering the third stage to participate in the operation. After the third level, a level of flip-flop is required to perform the final fourth level operation and final output.
  • the counting result of the first-level sub-counter (counting output signal) ultimately needs to go through three additional flip-flops to complete the operation.
  • the count of the first-level sub-counter is transmitted to the data alignment module 3 cycles earlier than the count result of the last-level sub-counter. Therefore, when the data is finally aligned, DS ⁇ 3:0> of the first-level sub-counter needs to be delayed by three clock cycles before it can be used as part of the final output counting result and matched with the counting output signals output by other sub-counters.
  • DS ⁇ 7:4> of the second-level sub-counter needs to go through a delay of two clock cycles; the third-level sub-counter needs to go through a delay of one clock cycle.
  • three third flip-flops are cascaded on the line that receives DS ⁇ 3:0> of the first-level sub-counter; two third flip-flops are cascaded on the line that receives DS ⁇ 7:4> of the second-level sub-counter.
  • a third flip-flop; a third flip-flop is cascaded on the line receiving DS ⁇ 11:8> of the third-level sub-counter.
  • the fourth-level sub-counter as an optional implementation method, similar to the previous sub-counters, the DS ⁇ 15:9> of the fourth-level sub-counter can be output to the data alignment module, so that no delay is required. When , it is directly output as part of the counting result; accordingly, there is no need to cascade the third flip-flop on the line receiving DS ⁇ 15:9> of the fourth-level sub-counter.
  • the last stage (specifically the fourth stage in this implementation) sub-counter preferably also passes through a flip-flop, that is, a line that receives the counting output signal of the last stage sub-counter. A third flip-flop is cascaded up.
  • the counting output signal received by the line corresponding to the last sub-counter in the counting module among the multiple lines is the signal of the counting input terminal.
  • the number of third flip-flops cascaded on the line is equal to the number of the counting module from the sub-counter corresponding to the line to the last sub-counter.
  • the number of second flip-flops between counters is increased by 1; specifically for the last sub-counter, there is no second flip-flop behind it, that is, the number is 0, and the number of third flip-flops cascaded on its corresponding line is equal to 0+1, that is, connect a third flip-flop.
  • the counting output signal includes the signal of the counting input terminal and the signal of the counting output terminal; among the multiple lines, except for the line corresponding to the last stage sub-counter, the counting output signal received is the signal of the counting output terminal.
  • the embodiments of the present application are not limited to this.
  • the received counting output signal can also be the signal of the counting input terminal, and should also be considered. It works.
  • the counter provided by the embodiment of the present application can also include a clock module.
  • the clock module is used to generate a first clock signal and a second clock signal.
  • the counting module is based on the first clock signal.
  • the data alignment module works based on the second clock signal.
  • the clock module includes a clock signal input terminal (please refer to CLOCK in the figure), a first clock signal output terminal (please refer to CLOCK1 in the figure), and a second clock signal output terminal (please refer to CLOCK2 in the figure).
  • the clock module mainly generates the first clock signal and the second clock signal for use by the counting module and the data alignment module based on the clock signal input from the clock signal input terminal.
  • the phase difference between the first clock signal and the second clock signal can be set according to actual conditions. Specifically, the phase relationship between the two clock signals can be formulated according to the delay of the device that implements the counter, thereby ensuring maximum timing margin. As an optional implementation manner, there may be no phase difference between the first clock signal and the second clock signal, and the two clock signals may be synchronized. As another optional implementation manner, there is a phase difference between the first clock signal and the second clock signal. It is understandable that sometimes in order to achieve a higher speed, CLOCK2 can be made faster or slower than CLOCK1, so as to achieve sufficient timing margin.
  • the clock module also needs to consider increasing the driving capability of the clock.
  • the clock module includes a clock signal input terminal and a first clock generation line and a second clock generation line connected to the clock signal input terminal; the first clock generation line is used to generate a clock signal based on the clock signal input terminal.
  • the clock signal input at the signal input terminal generates a first clock signal; the second clock generation line is used to generate a second clock signal based on the clock signal input at the clock signal input terminal; the first clock generation line and/or the second clock generation line are connected There are delay units.
  • two delay units (delay unit 1 and delay unit 2) are connected to the first clock generation line and two delay units (delay unit 3 and delay unit 4) are connected to the second clock generation line as an example.
  • two delay units (delay unit 3 and delay unit 4) are connected to the second clock generation line as an example.
  • a total of four delay units are used.
  • At least two delay units may be connected to the first clock generation line and the second clock generation line respectively; thus, compared with using one delay unit, the flexibility of phase adjustment is further increased. Moreover, when there are more than two delay units connected on the line, the fan-out capability of the delay unit located at the next level is greater than the fan-out capability of the delay unit located at the previous level; thus, the fan-out capability is gradually expanded to achieve stronger driving ability.
  • Each embodiment of the present application can be applied to a high-speed pattern generator.
  • the embodiment adopts a pipeline structure. After the carry bit of each sub-counter is output, it is clicked by a flip-flop to form a pipeline structure to offset the delay of the carry chain; each sub-counter will output its own DA and DS, data
  • the alignment module mainly receives the DS and DA values output by the pipeline counter, and through the determined timing relationship, aligns the data belonging to the same counting cycle to form the final output. In this way, the problem that the carry chain of the traditional counter structure is too long causes the carry delay to be too long, thereby restricting the maximum operating speed of the counter.
  • the clock phase relationship can be freely adjusted according to the characteristics of the process device itself, maximizing the counter speed under the same set of processes.
  • Each embodiment of the present application can achieve a great improvement in the running speed of the counter without changing the digital standard device used, which is of great significance in terms of function and cost.

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

Provided in the embodiments of the present application is a counter, comprising: a counting module, which comprises a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters among the plurality of sub-counters, wherein the sub-counters are used for counting the number of clock pulses to output count output signals and carry output signals, and the delay unit is used for receiving a carry output signal from the sub-counter at the former stage among the at least two sub-counters, delaying the received carry output signal and outputting same to the sub-counter at the latter stage; and a data alignment module, which is used for receiving the count output signals from the plurality of sub-counters and performing, according to a correspondence with a delay time caused by the delay unit, data alignment on a plurality of received count output signals that belong to the same counting period, so as to output a counting result. In this way, the operating speed of the counter is increased while the counting accuracy is ensured, thereby facilitating the implementation of a counter having more bits.

Description

计数器counter 技术领域Technical field
本发明涉及电路与系统技术领域,特别是涉及一种计数器。The invention relates to the technical field of circuits and systems, and in particular to a counter.
背景技术Background technique
计数器是一种常用的时序逻辑电路,是数字电路的重要组成部分,它的最基础的功能是通过统计时钟脉冲的个数来完成计数。The counter is a commonly used sequential logic circuit and an important part of digital circuits. Its most basic function is to count by counting the number of clock pulses.
计数器的bit数(位数/比特数)越高,实现高速越困难。这主要与计数器的组成结构有关,计数器利用与门用来产生进位,随着计数器位数的增多,与门的输入会一级比一级多。当与门的输入超过一定程度的时候,不得不分层级来进行与运算,即将前面几个数据先进行与运算,运算的结果再进入新的与门进行下一级运算。然而,这将导致进位信号的传播延时上升,并且当与门的层级数量增多至进位信号的传播延时达到能与时钟周期相比拟的时候,计数器的速度就到极限了。可见,传统计数器结构位数越高,速度越慢;这成为高速计数器最大的局限。此外,传播延时还容易造成计数错误的问题。The higher the number of bits (digits/number of bits) of the counter, the more difficult it is to achieve high speed. This is mainly related to the structure of the counter. The counter uses the AND gate to generate carry. As the number of digits in the counter increases, the inputs of the AND gate will increase one level at a time. When the input of the AND gate exceeds a certain level, the AND operation has to be performed hierarchically, that is, the first few data are ANDed first, and the result of the operation then enters the new AND gate for the next level operation. However, this will cause the propagation delay of the carry signal to increase, and when the number of AND gate levels increases to the point where the propagation delay of the carry signal becomes comparable to the clock cycle, the speed of the counter reaches its limit. It can be seen that the higher the number of digits in the traditional counter structure, the slower the speed; this becomes the biggest limitation of high-speed counters. In addition, propagation delays can easily cause counting errors.
如何在保证计数准确性的前提下,不断提升计数器的运行速度,实现高位数的计数器,是本领域一直致力解决的重要技术问题。How to continuously improve the running speed of the counter and realize a high-digit counter while ensuring the counting accuracy is an important technical problem that this field has been trying to solve.
发明内容Contents of the invention
有鉴于此,本申请实施例为解决背景技术中存在的至少一个问题而提供一种计数器。In view of this, embodiments of the present application provide a counter to solve at least one problem existing in the background art.
本申请一实施例提供了一种计数器,包括:An embodiment of the present application provides a counter, including:
计数模块,包括多个级联的子计数器和连接在多个所述子计数器中至少两个相邻的子计数器之间的延迟单元;其中,所述子计数器用于对时钟脉冲的个数进行计数以输出计数输出信号和进位输出信号;所述延迟单元用于接收所述至少两个子计数器中前一级子计数器的进位输出信号,并将接收到的所述进位输出信号进行延迟后输出至后一级子计数器;A counting module includes a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters in the plurality of sub-counters; wherein the sub-counters are used to count the number of clock pulses. Count to output a count output signal and a carry output signal; the delay unit is used to receive the carry output signal of the previous sub-counter in the at least two sub-counters, and delay the received carry output signal before outputting it to The next level sub-counter;
数据对齐模块,用于接收多个所述子计数器的计数输出信号,并按照与所述延迟单元导致的延迟时间对应的关系将接收到的属于同一个计数周期的多个所述计数输出信号进行数据对齐,以输出计数结果。A data alignment module, configured to receive counting output signals of multiple sub-counters, and align the received multiple counting output signals belonging to the same counting cycle according to the relationship corresponding to the delay time caused by the delay unit. Data alignment to output count results.
在一可选实施方式中,所述多个子计数器中每相邻两级子计数器之间设置有一延迟单元。In an optional implementation, a delay unit is provided between every two adjacent levels of sub-counters in the plurality of sub-counters.
在一可选实施方式中,所述延迟单元包括触发器,所述触发器以时钟脉冲作为控制信号,接收所述前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至所述后一级子计数器。In an optional implementation, the delay unit includes a flip-flop, which uses a clock pulse as a control signal to receive the carry output signal of the previous stage sub-counter and output the delayed carry output signal to the The next level sub-counter.
在一可选实施方式中,至少一所述子计数器为n位(n bit)计数器,其中,n大于1;所述n位计数器中的各位之间通过与门产生进位信号;In an optional implementation, at least one of the sub-counters is an n-bit (n-bit) counter, where n is greater than 1; a carry signal is generated between each bit in the n-bit counter through an AND gate;
所述n位计数器中至少一位的与门的输入端与上一位的与门的输入端相连;The input end of at least one AND gate in the n-bit counter is connected to the input end of the previous one-bit AND gate;
所述n位计数器中包括不超过一位的与门采用如下连接方式:该位的与门的输入端与上一位的与门的输出端相连。The n-bit counter including no more than one AND gate adopts the following connection method: the input end of the AND gate of this bit is connected to the output end of the previous bit AND gate.
在一可选实施方式中,所述数据对齐模块包括触发器,所述数据对齐模块基于所述触发器进行数据对齐。In an optional implementation, the data alignment module includes a trigger, and the data alignment module performs data alignment based on the trigger.
在一可选实施方式中,所述子计数器为n位(n bit)计数器,其中,n大于等于1;所述n位计数器中的每一位包括一个第一触发器;所述第一触发器包括计数输入端以及计数输出端;所述计数输出信号包括所述计数输入端的信号和/或所述计数输出端的信号;In an optional implementation, the sub-counter is an n-bit counter, where n is greater than or equal to 1; each bit in the n-bit counter includes a first flip-flop; the first flip-flop The device includes a counting input terminal and a counting output terminal; the counting output signal includes a signal of the counting input terminal and/or a signal of the counting output terminal;
所述延迟单元包括至少一个第二触发器;所述第二触发器以时钟脉冲作为控制信号,接收所述前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至所述后一级子计数器;The delay unit includes at least one second flip-flop; the second flip-flop uses a clock pulse as a control signal to receive the carry output signal of the previous sub-counter and output the delayed carry output signal to the subsequent sub-counter. Level sub counter;
所述数据对齐模块包括至少一个第三触发器,所述数据对齐模块基于所述第三触发器进行数据对齐;The data alignment module includes at least one third flip-flop, and the data alignment module performs data alignment based on the third flip-flop;
所述数据对齐模块包括与多个所述子计数器对应的多条线路,所述多条线路中的每条线路接收对应的子计数器的计数输出信号;The data alignment module includes a plurality of lines corresponding to a plurality of the sub-counters, and each line in the plurality of lines receives a counting output signal of a corresponding sub-counter;
对于所述多条线路中的接收的计数输出信号为计数输出端的信号的线路,该条线路上级联的所述第三触发器的数量与所述计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量相等;For a line among the plurality of lines in which the received counting output signal is a signal at a counting output terminal, the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line. The number of second flip-flops to the last sub-counter is equal;
对于所述多条线路中的接收的计数输出信号为计数输入端的信号的线路,该条线路上级联的所述第三触发器的数量等于所述计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器 的数量加1。For a line among the plurality of lines in which the received counting output signal is a signal at the counting input end, the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line. The number of second flip-flops to the last sub-counter is incremented by one.
在一可选实施方式中,所述多条线路中与所述计数模块中最后一级子计数器对应的线路,接收的计数输出信号为计数输入端的信号。In an optional implementation, the counting output signal received by the line corresponding to the last stage sub-counter in the counting module among the plurality of lines is the signal of the counting input terminal.
在一可选实施方式中,所述计数输出信号包括所述计数输入端的信号和所述计数输出端的信号;所述多条线路中除与所述最后一级子计数器对应的线路以外的其他线路,接收的计数输出信号为计数输出端的信号。In an optional implementation, the counting output signal includes a signal of the counting input terminal and a signal of the counting output terminal; among the plurality of lines, other lines except the line corresponding to the last stage sub-counter , the received counting output signal is the signal at the counting output terminal.
在一可选实施方式中,还包括时钟模块,In an optional implementation, it also includes a clock module,
所述时钟模块用于产生第一时钟信号和第二时钟信号,所述计数模块基于所述第一时钟信号工作,所述数据对齐模块基于所述第二时钟信号工作。The clock module is used to generate a first clock signal and a second clock signal, the counting module operates based on the first clock signal, and the data alignment module operates based on the second clock signal.
在一可选实施方式中,所述时钟模块包括时钟信号输入端以及与所述时钟信号输入端连接的第一时钟产生线路和第二时钟产生线路;所述第一时钟产生线路用于基于所述时钟信号输入端输入的时钟信号产生所述第一时钟信号;所述第二时钟产生线路用于基于所述时钟信号输入端输入的时钟信号产生所述第二时钟信号;所述第一时钟产生线路和/或所述第二时钟产生线路上连接有延迟单元。In an optional implementation, the clock module includes a clock signal input end and a first clock generation line and a second clock generation line connected to the clock signal input end; the first clock generation line is used to generate the clock signal based on the clock signal input end. The clock signal input to the clock signal input terminal generates the first clock signal; the second clock generation circuit is used to generate the second clock signal based on the clock signal input to the clock signal input terminal; the first clock A delay unit is connected to the generation line and/or the second clock generation line.
在一可选实施方式中,所述第一时钟产生线路和所述第二时钟产生线路上分别连接有至少两个延迟单元,并且位于后一级的延迟单元的扇出能力大于位于前一级的延迟单元的扇出能力。In an optional implementation, at least two delay units are respectively connected to the first clock generation line and the second clock generation line, and the delay unit located at the later stage has a fan-out capacity greater than that at the previous stage. The fan-out capability of the delay unit.
本申请实施例所提供的计数器,通过在多个子计数器中至少两个相邻的子计数器之间设置延迟单元,延迟单元用于接收至少两个子计数器中前一级子计数器的进位输出信号,并将接收到的进位输出信号进行延迟后输出至后一级子计数器;进一步通过数据对齐模块接收多个子计数器的计数输出信号,并按照与延迟单元导致的延迟时间对应的关系将接收到的属于同一个计数周期的多个计数输出信号进行数据对齐,最终输出计数结果;如此,解决了传统计数器结构中进位信号的传播延时对计数准确性和运行速度造成限制的问题,在保证计数准确性的前提下,提升了计数器的运行速度,有利于实现更高位数的计数器。The counter provided by the embodiment of the present application is provided with a delay unit between at least two adjacent sub-counters among the plurality of sub-counters. The delay unit is used to receive the carry output signal of the previous sub-counter in at least two sub-counters, and Delay the received carry output signal and output it to the subsequent sub-counter; further receive the count output signals of multiple sub-counters through the data alignment module, and according to the relationship corresponding to the delay time caused by the delay unit, the received carry output signal belongs to the same Multiple counting output signals in one counting cycle are data aligned, and the counting result is finally output; in this way, the problem of the propagation delay of the carry signal in the traditional counter structure that limits the counting accuracy and operating speed is solved, while ensuring the counting accuracy. Under the premise, the running speed of the counter is improved, which is conducive to realizing a higher-digit counter.
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the attached picture:
图1为本申请一实施例提供的计数器的结构示意图;Figure 1 is a schematic structural diagram of a counter provided by an embodiment of the present application;
图2为本申请一实施例中计数模块的结构示意图;Figure 2 is a schematic structural diagram of a counting module in an embodiment of the present application;
图3为本申请一实施例中子计数的结构示意图;Figure 3 is a schematic structural diagram of neutron counting according to an embodiment of the present application;
图4为本申请一实施例中数据对齐模块的结构示意图;Figure 4 is a schematic structural diagram of a data alignment module in an embodiment of the present application;
图5为本申请一实施例中时钟模块的结构示意图;Figure 5 is a schematic structural diagram of a clock module in an embodiment of the present application;
图6为本申请一具体示例提供的计数器的结构示意图。Figure 6 is a schematic structural diagram of a counter provided in a specific example of this application.
具体实施方式Detailed ways
为使本发明的技术方案和有益效果能够更加明显易懂,下面通过列举具体实施例的方式,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the technical solutions and beneficial effects of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present application are clearly and completely described below by enumerating specific embodiments. Obviously, the described embodiments are only for the purpose of this application. Apply for some of the embodiments, not all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used in the description of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一电阻称为第二电阻,且类似地,可将第二电阻称为第一电阻。第一电阻和第二电阻两者都是电阻,但其不是同一电阻。当描述“第一”时,并不表示必然存在“第二”;而当讨论“第二”时,也并不表明本申请必然存在第一元件、部件、区、层或部分。在此使用时,单数形式的“一”、“一个”和“所述/该”也可能意图包括复数形式,除非上下文清楚指出另外的方式。“多个”的含义是两个以上,除非另有明确具体的限定。还应明白术语“包括”,当在该说明书中使用时,确定所述特征的存在,但不 排除一个或更多其它的特征的存在或添加。在此使用时,术语“和/或”包括相关所列项目的任何及所有组合。It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first resistor may be referred to as a second resistor, and similarly, the second resistor may be referred to as a first resistor, without departing from the scope of the present application. The first resistor and the second resistor are both resistors, but they are not the same resistor. When a "first" is described, it does not mean that there must be a "second"; and when a "second" is discussed, it does not mean that there must be a first element, component, region, layer or section in the present application. As used herein, the singular forms "a," "an," and "the" may also be intended to include the plural forms as well, unless the context clearly dictates otherwise. "Plural" means more than two, unless otherwise clearly and specifically limited. It will also be understood that the term "comprising", when used in this specification, identifies the presence of stated features but does not exclude the presence or addition of one or more other features. When used herein, the term "and/or" includes any and all combinations of the associated listed items.
首先,请参考图1。本申请实施例提供的计数器包括计数模块和数据对齐模块。First, please refer to Figure 1. The counter provided by the embodiment of the present application includes a counting module and a data alignment module.
具体的,计数模块包括多个级联的子计数器和连接在多个子计数器中至少两个相邻的子计数器之间的延迟单元。Specifically, the counting module includes a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters in the plurality of sub-counters.
图1中以计数模块包括第一子计数器、第二子计数器……第N子计数器,以及包括第一延迟单元、第二延迟单元为例示出。应当理解,本申请实施例中子计数器的数量可以足够多以实现更大数量的计数,例如,子计数器的数量可以为数十个、数百个或者更多;本申请对此并不做具体限制。并且,本申请提出的改进的技术方案至少适用于子计数器的数量不少于两个(即N可以为两个以上)的计数器中。Figure 1 shows an example in which the counting module includes a first sub-counter, a second sub-counter... an N-th sub-counter, and a first delay unit and a second delay unit. It should be understood that the number of sub-counters in the embodiment of the present application can be large enough to achieve a larger number of counts. For example, the number of sub-counters can be dozens, hundreds or more; this application does not specify this. limit. Moreover, the improved technical solution proposed in this application is at least applicable to counters with no less than two sub-counters (that is, N can be more than two).
通过各子计数器级联,可以起到扩容的效果。结合图3所示,各子计数器包括进位输入端CI和进位输出端CO;各子计数器级联指的是,位于前一级的子计数器的进位输出端CO耦接至位于后一级的子计数器的进位输入端CI。从而,位于前一级的子计数器通过进位输出端CO输出进位输出信号,并且该进位输出信号作为位于后一级的子计数器的输入而传输至该后一级的子计数器的进位输入端CI,以参与该后一级的子计数器的计数运算。可以理解,本申请上下文中“耦接”表示被耦接的一端与耦接至的一端之间相互具有电信号或数据的传递,可理解为“电连接”、“通信连接”等。By cascading each sub-counter, the capacity can be expanded. As shown in Figure 3, each sub-counter includes a carry input terminal CI and a carry output terminal CO; the cascade connection of each sub-counter means that the carry output terminal CO of the sub-counter located at the previous stage is coupled to the sub-counter located at the subsequent stage. The carry input terminal CI of the counter. Therefore, the sub-counter located at the previous stage outputs a carry output signal through the carry output terminal CO, and the carry output signal is transmitted as the input of the sub-counter located at the subsequent stage to the carry input terminal CI of the sub-counter at the subsequent stage, To participate in the counting operation of the subsequent sub-counter. It can be understood that "coupling" in the context of this application means that the coupled end and the coupled end have mutual transmission of electrical signals or data, which can be understood as "electrical connection", "communication connection", etc.
此外,各子计数器还包括时钟信号输入端和计数输出端。其中,时钟信号输入端可以参考图1中各子计数器与CLOCK1连接的一端或者图3中子计数器与CLOCK连接的一端。各子计数器通过时钟信号输入端接收时钟信号,时钟信号具体为时钟脉冲的形式,子计数器用于对时钟脉冲的个数进行计数以输出计数输出信号和进位输出信号。In addition, each sub-counter also includes a clock signal input terminal and a counting output terminal. Among them, the clock signal input end can refer to the end of each sub-counter connected to CLOCK1 in Figure 1 or the end of the sub-counter connected to CLOCK in Figure 3. Each sub-counter receives a clock signal through a clock signal input terminal. The clock signal is specifically in the form of a clock pulse. The sub-counter is used to count the number of clock pulses to output a count output signal and a carry output signal.
以4bit计数器为例,时钟脉冲每增加一个,输出计数输出信号变化一次,具体的,计数从0000、0001、0010、0011……一直变化至1111,共可以输出16种结果(时钟脉冲的个数从0变化至15),这16种结果通过高电平表示1、低电平表示0的方式向外输出的信号即为计数输出信号。而在计数结果达到1111之后,时钟脉冲再次增加一个,显然已经超出了目前的4位能够表示的最大值,此时需要进位,即进位输出1、计数结果变为0000;可以理解的,在二进制中,10000表示16,即时钟脉冲的个数从0变化至16。进位输出1具体体现为进位输出信号的电平发生变化。Taking a 4-bit counter as an example, every time the clock pulse increases, the output count output signal changes once. Specifically, the count changes from 0000, 0001, 0010, 0011... to 1111, and a total of 16 results (the number of clock pulses) can be output From 0 to 15), the signals output by these 16 results through high level representing 1 and low level representing 0 are the counting output signals. After the counting result reaches 1111, the clock pulse increases by one again, which obviously exceeds the maximum value that can be represented by the current 4 bits. At this time, a carry is required, that is, the carry output is 1, and the counting result becomes 0000; understandably, in binary , 10000 means 16, that is, the number of clock pulses changes from 0 to 16. Carry output 1 is specifically reflected in a change in the level of the carry output signal.
可见,计数输出信号表示的是与计数器对时钟脉冲的个数进行计数的具体结果对应的信号;进位输出信号表示的是当计数器达到最大计数值后,时钟脉冲再次增加,计数结果需要进位时输出的信号。进位输入端CI用于输出进位输出信号;计数输出端用于输出计数输出信号。It can be seen that the count output signal represents the signal corresponding to the specific result of the counter counting the number of clock pulses; the carry output signal represents the signal that is output when the counter reaches the maximum count value and the clock pulse increases again, and the count result requires a carry. signal of. The carry input terminal CI is used to output the carry output signal; the count output terminal is used to output the count output signal.
计数输出端可以参考图1中的D1、D2……DN,或者图3中的DA<0>至DA<3>和/或DS<0>至DS<3>;在下文中,DA<0>至DA<3>将采用DA<3:0>表示,DS<0>至DS<3>将采用DS<3:0>表示;显然,图1中的DA<3:0>和/或DS<3:0>与图1中的D1相对应,当然,图1中的D2至DN也可以与D1相同或相似。The counting output can refer to D1, D2...DN in Figure 1, or DA<0> to DA<3> and/or DS<0> to DS<3> in Figure 3; in the following, DA<0> to DA<3> will be represented by DA<3:0>, and from DS<0> to DS<3> will be represented by DS<3:0>; obviously, DA<3:0> and/or DS in Figure 1 <3:0> corresponds to D1 in Figure 1. Of course, D2 to DN in Figure 1 can also be the same or similar to D1.
延迟单元用于接收至少两个子计数器中前一级子计数器的进位输出信号,并将接收到的进位输出信号进行延迟后输出至后一级子计数器。具体参考图1,第一延迟单元接收第一子计数器的进位输出信号,并将接收到的进位输出信号进行延迟后输出至第二子计数器。图1中示出了多个子计数器中每相邻两级子计数器之间设置有一延迟单元的情况;在具体应用中,可以采用这种设置方式以使得整个计数模块的元器件呈周期性的搭建,从而结构简单,运行稳定性高,并且极大程度的避免了进位信号的传播延时造成的影响。当然,对于延迟单元的设置数量及设置位置,也可以根据实际需求具体选择。在本实施例中,至少在一对相邻的两个子计数器之间设置延迟单元,从而至少在一定程度上降低因与门运算产生的进位信号传播时延对计数器的数量和准确性的影响。The delay unit is configured to receive a carry output signal of a previous sub-counter in at least two sub-counters, delay the received carry output signal and then output it to a subsequent sub-counter. Referring specifically to FIG. 1 , the first delay unit receives the carry output signal of the first sub-counter, delays the received carry output signal, and then outputs it to the second sub-counter. Figure 1 shows the situation where a delay unit is provided between each two adjacent sub-counters in multiple sub-counters; in specific applications, this arrangement can be used to make the components of the entire counting module periodically , thus having a simple structure, high operational stability, and greatly avoiding the impact of the propagation delay of the carry signal. Of course, the number and location of delay units can also be selected based on actual needs. In this embodiment, a delay unit is provided at least between a pair of two adjacent sub-counters, thereby reducing, at least to a certain extent, the impact of the carry signal propagation delay caused by the AND gate operation on the number and accuracy of the counters.
可以理解的,延迟单元可以使得前一级子计数器的进位输出信号经过确切时长或者确切周期的延迟后,传输给后一级子计数器,从而后一级子计数器能够在确切时长或者确切周期参与计数运算;换言之,延迟单元对进位输出信号所做的延迟是指与进位输出信号直接传输至后一级子计数器相比,进位输出信号在更晚的时间被传输至后一级子计数器,然而,正是因为通过延迟单元可以控制确切时长或者确切周期,因此进位输出信号传输至后一级子计数器的时刻与时钟信号相比几乎没有延迟,从而避免了因与门运算造成的时延。It can be understood that the delay unit can cause the carry output signal of the previous sub-counter to be transmitted to the subsequent sub-counter after a delay of an exact duration or an exact period, so that the subsequent sub-counter can participate in counting at an exact duration or exact period. operation; in other words, the delay made by the delay unit to the carry output signal means that compared with the carry output signal being directly transmitted to the subsequent sub-counter, the carry output signal is transmitted to the subsequent sub-counter at a later time. However, Precisely because the exact duration or exact period can be controlled through the delay unit, there is almost no delay when the carry output signal is transmitted to the subsequent sub-counter compared with the clock signal, thereby avoiding the delay caused by the AND gate operation.
数据对齐模块,用于接收多个子计数器的计数输出信号,并按照与延迟单元导致的延迟时间对应的关系将接收到的属于同一个计数周期的多个计数输出信号进行数据对齐,以输出计数结果。The data alignment module is used to receive the counting output signals of multiple sub-counters and align the received multiple counting output signals belonging to the same counting cycle according to the relationship corresponding to the delay time caused by the delay unit to output the counting results. .
具体例如,在第一时刻,第一子计数器将计数输出信号(比如DS<3:0>)传输至数据对齐模块;由于第一延迟单元的存在,第二子计数器需要在第二时刻才能将其计数输出信号(比如DS<7:4>)传输至数据对齐模块,可见,第一延迟单元导致的延迟时间造成了第二时刻与第一时刻的差距;类似的,如果第二子计数器的进位输出信号经过第二延迟单元后输出至第三子计数器(图1中未示出),那么,第三子计数器需要在第三时刻才能将其计数输出信号(比如DS<11:8>)传输至数据对齐模块,第三时刻比第二时刻晚了因第二延迟单元导致的延迟时间,第三时刻比第一时刻晚了因第一延迟单元和第二延迟单元共同导致的延迟时间。数据对齐模块将在不同的时刻接收到各子计数器的计数输出信号DS<3:0>、DS<7:4>和DS<11:8>,然而,DS<3:0>、DS<7:4>和DS<11:8>事实上属于同一个计数周期;数据对齐模块被配置为按照与延迟单元导致的延迟时间对应的关系,在时间上将DS<3:0>、DS<7:4>和DS<11:8>对齐,从而输出计数结果。其中,对应的关系如:DS<3:0>比DS<11:8>早了因第一延迟单元和第二延迟单元共同导致的延迟时间,DS<7:4>比DS<11:8>早了因第二延迟单元导致的延迟时间。For example, at the first moment, the first sub-counter transmits the counting output signal (such as DS<3:0>) to the data alignment module; due to the existence of the first delay unit, the second sub-counter needs to transfer the count output signal at the second moment. Its counting output signal (such as DS<7:4>) is transmitted to the data alignment module. It can be seen that the delay time caused by the first delay unit causes the gap between the second moment and the first moment; similarly, if the second sub-counter The carry output signal is output to the third sub-counter (not shown in Figure 1) after passing through the second delay unit. Then, the third sub-counter needs to count the output signal at the third moment (such as DS<11:8>) When transmitted to the data alignment module, the third time is later than the second time by the delay time caused by the second delay unit, and the third time is later than the first time by the delay time caused by the first delay unit and the second delay unit. The data alignment module will receive the counting output signals DS<3:0>, DS<7:4> and DS<11:8> of each sub-counter at different times. However, DS<3:0>, DS<7 :4> and DS<11:8> actually belong to the same counting cycle; the data alignment module is configured to time-align DS<3:0> and DS<7 according to the relationship corresponding to the delay time caused by the delay unit. :4> and DS<11:8> are aligned to output the counting result. Among them, the corresponding relationship is as follows: DS<3:0> is earlier than DS<11:8> due to the delay time caused by the first delay unit and the second delay unit, DS<7:4> is earlier than DS<11:8 >The delay time caused by the second delay unit is earlier.
由此可知,本申请实施例通过在多个子计数器中至少两个相邻的子计数器之间设置延迟单元,延迟单元用于接收至少两个子计数器中前一级子计数器的进位输出信号,并将接收到的进位输出信号进行延迟后输出至后一级子计数器;进一步通过数据对齐模块接收多个子计数器的计数输出信号,并按照与延迟单元导致的延迟时间对应的关系将接收到的属于同一个计数周期的多个计数输出信号进行数据对齐,最终输出计数结果;从而解决了传统计数器结构中进位信号的传播延时对计数准确性和运行速度造成限制的问题,在保证计数准确性的前提下,提升了计数器的运行速度,有利于实现更高位数的计数器。It can be seen from this that the embodiment of the present application sets a delay unit between at least two adjacent sub-counters among the plurality of sub-counters. The delay unit is used to receive the carry output signal of the previous sub-counter in at least two sub-counters, and The received carry output signal is delayed and output to the subsequent sub-counter; further, the count output signals of multiple sub-counters are received through the data alignment module, and the received ones belong to the same one according to the relationship corresponding to the delay time caused by the delay unit. Multiple counting output signals of the counting cycle are data aligned, and the counting result is finally output; thus solving the problem that the propagation delay of the carry signal in the traditional counter structure limits the counting accuracy and operating speed, while ensuring the counting accuracy. , which improves the running speed of the counter and is conducive to the realization of higher-digit counters.
在一具体实施例中,延迟单元包括触发器,触发器以时钟脉冲作为控制信号,接收前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至后一级子计数器。In a specific embodiment, the delay unit includes a flip-flop, which uses clock pulses as control signals to receive the carry output signal of the previous stage sub-counter and output the delayed carry output signal to the subsequent stage sub-counter.
可以理解的,触发器可以提供整数周期的延迟,并且作为计数器中常用的电路元件,可以简化器件结构,实现稳定可靠的延迟效果。但是,本申请中延迟单元的具体选择也可以不限于此,其他能够实现对前一级子计数器的进位输出信号进行延迟的元器件也可以应用于此,比如可编程延迟模块等。It can be understood that the flip-flop can provide a delay of an integer period, and as a commonly used circuit element in counters, it can simplify the device structure and achieve a stable and reliable delay effect. However, the specific selection of the delay unit in this application is not limited to this. Other components that can delay the carry output signal of the previous sub-counter can also be applied here, such as programmable delay modules.
图2示出了一种具体的计数模块的结构示意图。计数模块包括多个级联的子计数器和连接在每相邻两级子计数器之间的触发器。触发器包括时钟信号输入端、接收数据信号的D端以及输出延迟数据信号Q端。触发器的时钟信号输入端可以参考图中与CLOCK1连接的一端,触发器通过时钟信号输入端接收时钟信号,时钟信号具体为时钟脉冲的形式,触发器以时钟脉冲作为控制信号,从一个稳定状态翻转到另一个稳定状态。触发器的时钟信号输入端与各子计数器的时钟信号输入端连接于同一时钟信号(如图中CLOCK1),从而在同一时钟信号的控制下工作。触发器的D端与前一级子计数器的进位输出端相连(进位输出端参考图中CO0、CO1),从而接收前一级子计数器的进位输出信号;触发器的Q端与后一级子计数器的进位输入端相连,从而输出延迟后的进位输出信号至后一级子计数器。在具体应用中,触发器与前一级子计数器和与后一级子计数器之间可以直接连接,即之间不包括除导线以外的其他元器件。Figure 2 shows a schematic structural diagram of a specific counting module. The counting module includes a plurality of cascaded sub-counters and a flip-flop connected between each two adjacent levels of sub-counters. The flip-flop includes a clock signal input terminal, a D terminal that receives a data signal, and a Q terminal that outputs a delayed data signal. The clock signal input end of the flip-flop can refer to the end connected to CLOCK1 in the figure. The flip-flop receives the clock signal through the clock signal input end. The clock signal is specifically in the form of a clock pulse. The flip-flop uses the clock pulse as the control signal to start from a stable state. flip to another stable state. The clock signal input terminal of the flip-flop and the clock signal input terminal of each sub-counter are connected to the same clock signal (CLOCK1 in the figure), and thus work under the control of the same clock signal. The D terminal of the flip-flop is connected to the carry output terminal of the previous sub-counter (the carry output terminal refers to CO0 and CO1 in the figure), thereby receiving the carry output signal of the previous sub-counter; the Q terminal of the flip-flop is connected to the carry output terminal of the subsequent sub-counter. The carry input terminal of the counter is connected to output the delayed carry output signal to the subsequent sub-counter. In specific applications, the flip-flop can be directly connected to the previous-level sub-counter and the subsequent-level sub-counter, that is, no other components other than wires are included therebetween.
为了便于区分,在下文描述中,作为延迟单元的触发器也可能被称为“第二触发器”。在各个实施例中,第二触发器可以是D触发器。当然,本申请也不限于此,在其他实施例中,也可以利用其他延迟电路。In order to facilitate distinction, in the following description, the flip-flop serving as the delay unit may also be referred to as the "second flip-flop". In various embodiments, the second flip-flop may be a D flip-flop. Of course, the present application is not limited to this. In other embodiments, other delay circuits may also be used.
接下来,请参考图3。应当理解,本申请描述中,由于考虑到计时器中的计数模块通过多个计数器级联组成,因此为了便于区分,将被级联的计数器称为“子计数器”;但是,这并不意味着子计数器与本领域技术人员通常理解的计数器有所不同。作为示例,图3示出了一种子计数器的结构示意图。如图所示,该子计数器包括触发器、异或门和与门;为便于区分,在下文描述中,子计数器中的触发器也可能被称为“第一触发器”。该子计数器为4bit计数器,包括4组周期性排布的触发器、异或门和与门,并且每一组触发器、异或门和与门对应于4bit计数器中的一位。其中,CI为进位输入端,CO为进位输出端;每一位中的DS为该位的计数输出端,DA为该位的计数输入端。由于DS与DA相比,信号经过触发器延迟后输出,因此DS处的信号通常比DA处的信号晚一个时钟周期,DA处的计数结果也可以称为计数器输出减1。Next, please refer to Figure 3. It should be understood that in the description of this application, it is considered that the counting module in the timer is composed of multiple counters cascaded, so for the convenience of distinction, the cascaded counters are called "sub-counters"; however, this does not mean that Sub-counters are different from counters as commonly understood by those skilled in the art. As an example, Figure 3 shows a schematic structural diagram of a sub-counter. As shown in the figure, the sub-counter includes a flip-flop, an XOR gate and an AND gate; for ease of distinction, in the following description, the flip-flop in the sub-counter may also be called the "first flip-flop". The sub-counter is a 4-bit counter, including 4 groups of periodically arranged flip-flops, XOR gates and AND gates, and each group of flip-flops, XOR gates and AND gates corresponds to one bit in the 4-bit counter. Among them, CI is the carry input terminal, CO is the carry output terminal; DS in each bit is the counting output terminal of the bit, and DA is the counting input terminal of the bit. Since the signal of DS is output after a flip-flop delay compared with DA, the signal at DS is usually one clock cycle later than the signal at DA. The counting result at DA can also be called the counter output minus 1.
作为计数模块中第一级的子计数器,其进位输入端CI可以不接入信号,如空置;作为计数模块中最后一级的子计数器,其进位输出端CO不与其他子计数器耦接,如空置;除此之外,级联于计数模块中间的子计数器,其进位输入端CI用于接收其前一级子计数器的进位输出端CO的输出信号,其进位输出端 CO用于将输出信号传输至其后一级子计数器的进位输入端CI。As the first-stage sub-counter in the counting module, its carry input terminal CI may not be connected to a signal, such as being left vacant; as the last-stage sub-counter in the counting module, its carry output terminal CO may not be coupled to other sub-counters, such as Vacant; in addition, the carry input terminal CI of the sub-counter cascaded in the middle of the counting module is used to receive the output signal of the carry output terminal CO of the previous sub-counter, and its carry output terminal CO is used to transfer the output signal It is transmitted to the carry input terminal CI of the subsequent sub-counter.
异或门具有两个输入端,其中一个输入端与位于同一组(或称同一位)中的触发器的Q端相连,另一个输入端与前一组(或称前一位)中的与门的输出端相连。对应于异或门的两个输入端接收到相同的输入信号,如二者均接收到高电平1,或者均接收到低电平0,则异或门的输出端输出低电平0;对应于异或门的两个输入端接收到不同的输入信号,如二者分别接收到高电平1和低电平0,则异或门的输出端输出高电平1。异或门的输出端与第一触发器的D端相连。The XOR gate has two input terminals, one of which is connected to the Q terminal of the flip-flop in the same group (or the same bit), and the other input terminal is connected to the AND in the previous group (or the previous bit). The output of the gate is connected. The two input terminals corresponding to the XOR gate receive the same input signal. If both receive a high level 1, or both receive a low level 0, then the output terminal of the XOR gate outputs a low level 0; The two input terminals corresponding to the XOR gate receive different input signals. If they receive a high level 1 and a low level 0 respectively, the output terminal of the XOR gate outputs a high level 1. The output terminal of the XOR gate is connected to the D terminal of the first flip-flop.
与门包括多个输入端和一个输出端。子计数器中的各位之间通过与门产生进位信号。对应于与门的多个输入端均接收到高电平1,则与门的输出端输出高电平1;除此之外,则与门的输出端输出低电平0。如前所述,与门的输出端与后一组(或称后一位)中的异或门的输入端相连。与门的一个输入端与位于同一组中的触发器的Q端相连;与门的其他输入端根据该与门所处的位数不同,可能有不同的连接方式。An AND gate consists of multiple inputs and an output. A carry signal is generated between each bit in the sub-counter through an AND gate. If multiple input terminals corresponding to the AND gate all receive high-level 1, then the output terminal of the AND gate outputs a high-level 1; otherwise, the output terminal of the AND gate outputs a low-level 0. As mentioned before, the output of the AND gate is connected to the input of the XOR gate in the next group (or last bit). One input terminal of the AND gate is connected to the Q terminal of the flip-flop in the same group; other input terminals of the AND gate may have different connection methods depending on the number of bits in which the AND gate is located.
位于子计数器中第一组(或称第一位)中的与门,其输入端与该子计数器的进位输入端CI。位于子计数器中第二组(或称第二位)以及第三组(或称第三位)中的与门,其输入端与上一位的与门的输入端相连。位于子计数器中第四组(或称第四位)中的与门,其输入端与上一位的与门的输出端相连。可以理解的,无论是与上一位的与门的所有输入端相连,还是与上一位的与门的输出端相连,基于与门的工作原理,其输出的结果是一样的。但是,对于与上一位的与门的所有输入端相连的情况,信号无需经过上一位的与门进行与运算,而仅通过导线传输,几乎没有传播时延;反之,如果与上一位的与门的输出端相连,则需要经过上一位的与门进行与运算,这将由于与门而带来传播时延的上升。The input terminal of the AND gate located in the first group (or first bit) of the sub-counter is connected to the carry input terminal CI of the sub-counter. The input terminals of the AND gates located in the second group (or second bit) and the third group (or third bit) of the sub-counter are connected to the input end of the AND gate in the previous bit. The input terminal of the AND gate located in the fourth group (or fourth bit) of the sub-counter is connected to the output terminal of the previous AND gate. It can be understood that whether it is connected to all the input terminals of the previous AND gate or to the output terminal of the previous AND gate, based on the working principle of the AND gate, the output result is the same. However, for the case where all the input terminals of the AND gate of the previous bit are connected, the signal does not need to go through the AND gate of the previous bit for AND operation, but is only transmitted through the wire, with almost no propagation delay; conversely, if it is connected to the AND gate of the previous bit If the output of the AND gate is connected, the AND operation needs to be performed through the previous AND gate, which will increase the propagation delay due to the AND gate.
虽然图3以4bit计数器为例示出,但是,可以理解的,随着计数器位数的增多,与门的输入会越来越多。然而与门的输入端的数量是有极限的,不可能无限增加,当与门输入超过一定程度的时候,不得不分层级来进行与运算。即,如图3中第四位中的与门一样,先由前一位与门将前面几位的数据进行与运算,运算的结果再输出至第四位与门进行下一级运算。Although Figure 3 shows a 4-bit counter as an example, it can be understood that as the number of bits in the counter increases, the number of inputs to the AND gate will increase. However, the number of input terminals of the AND gate is limited and cannot be increased infinitely. When the input of the AND gate exceeds a certain level, the AND operation has to be performed hierarchically. That is, just like the AND gate in the fourth bit in Figure 3, the previous bit AND gate performs an AND operation on the previous bits of data, and the result of the operation is then output to the fourth bit AND gate for the next level operation.
作为本申请一种可选的实施方式,至少一子计数器为n位(n bit)计数器,其中,n大于1;n位计数器中的各位之间通过与门产生进位信号;n位计数器中至少一位的与门的输入端与上一位的与门的输入端相连;n位计数器中包括不超过一位的与门采用如下连接方式:该位的与门的输入端与上一位的与门的输出端相连。可以理解的,当超过一位的与门需要采用输入端与上一位的与门的输出端相连的连接方式时,即该位与门的输入端的数量已经无法承受接收上一位的与门的所有输入信号,则可以不采用该与门,换言之,不采用包括两个以上采用上述连接方式的与门的子计数器,而采用本申请实施例提供的技术方案解决该问题。As an optional implementation manner of this application, at least one sub-counter is an n-bit (n-bit) counter, where n is greater than 1; a carry signal is generated between each bit in the n-bit counter through an AND gate; at least one of the n-bit counters The input end of the AND gate of one bit is connected to the input end of the AND gate of the previous bit; the n-bit counter including no more than one AND gate adopts the following connection method: the input end of the AND gate of this bit is connected to the input end of the previous bit AND gate. Connect to the output of the AND gate. It can be understood that when more than one-bit AND gate needs to be connected with the input terminal of the previous-bit AND gate, that is, the number of input terminals of the AND gate cannot bear to receive the previous-bit AND gate. For all input signals, the AND gate may not be used. In other words, the sub-counter including two or more AND gates using the above connection method may not be used, and the technical solution provided by the embodiment of the present application may be used to solve this problem.
可选的,n小于等于6。Optional, n is less than or equal to 6.
在实际应用中,子计数器可以为4bit计数器或者3bit计数器。子计数器中可以包括且仅包括一个采用如下连接方式进行连接的与门:该位的与门的输入端与上一位的与门的输出端相连;或者,可以不超过采用如下连接方式进行连接的与门:该位的与门的输入端与上一位的与门的输出端相连。In practical applications, the sub-counter can be a 4-bit counter or a 3-bit counter. The sub-counter may include and only include one AND gate connected using the following connection method: the input end of the AND gate of this bit is connected to the output end of the AND gate of the previous bit; or, it may not exceed the number of connections using the following connection method. AND gate: The input end of the AND gate of this bit is connected to the output end of the AND gate of the previous bit.
图4示出了一种数据对齐模块的结构示意图。如图所示,数据对齐模块包括计数输出信号接收端、时钟信号输入端以及计数结果输出端。Figure 4 shows a schematic structural diagram of a data alignment module. As shown in the figure, the data alignment module includes a counting output signal receiving end, a clock signal input end, and a counting result output end.
其中,计数输出信号接收端请参考图中的DA1-N和DS1-N;图中示出的结构并不表示数据对齐模块的计数输出信号接收端有两个,事实上,计数输出信号接收端可以有多个;并且,计数输出信号接收端可以既接收DA1-N和DS1-N的信号,也可以仅接收DA1-N或者仅接收DS1-N的信号,还可以接收DA1-N中的部分的信号以及接收DS1-N中的部分的信号。DA1-N和DS1-N可以结合图2和图3加以理解;以DA1为例,其表示图2中的位于第一级的子计数器(n bit计数器)的计数输入端,对应于图3中的DA<3:0>;类似的,DS1表示图2中的位于第一级的子计数器的计数输出端,对应于图3中的DS<3:0>。而DA1-N表示从DA1至DAN;类似的,DS1-N表示从DS1至DSN。Among them, please refer to DA1-N and DS1-N in the figure for the counting output signal receiving end; the structure shown in the figure does not mean that there are two counting output signal receiving ends of the data alignment module. In fact, the counting output signal receiving end There can be more than one; and, the counting output signal receiving end can receive both DA1-N and DS1-N signals, or only DA1-N or DS1-N signals, and can also receive part of DA1-N. signals as well as receiving signals from parts of the DS1-N. DA1-N and DS1-N can be understood in conjunction with Figure 2 and Figure 3; taking DA1 as an example, it represents the counting input end of the first-level sub-counter (n bit counter) in Figure 2, corresponding to Figure 3 DA<3:0>; Similarly, DS1 represents the counting output terminal of the first-level sub-counter in Figure 2, corresponding to DS<3:0> in Figure 3. DA1-N means from DA1 to DAN; similarly, DS1-N means from DS1 to DSN.
数据对齐模块的时钟信号输入端请参考图4中的CLOCK2。CLOCK2与CLOCK1可以时钟同步,也可以具有相位差。For the clock signal input end of the data alignment module, please refer to CLOCK2 in Figure 4. CLOCK2 and CLOCK1 can be clock synchronized or have phase differences.
数据对齐模块的计数结果输出端请参考图4中的DOUT,该计数结果输出端配置为输出计数结果。For the counting result output terminal of the data alignment module, please refer to DOUT in Figure 4. The counting result output terminal is configured to output the counting result.
请参考图6,在本申请的一可选实施例中,数据对齐模块包括触发器,数据对齐模块基于触发器进行数据对齐。Please refer to Figure 6. In an optional embodiment of the present application, the data alignment module includes a flip-flop, and the data alignment module performs data alignment based on the flip-flop.
在一更具体的可选实施例中,子计数器为n位(n bit)计数器,其中,n大于等于1;n位计数器中的每一位包括一个第一触发器;第一触发器包括计数输入端以及计数输出端;计数输出信号包括计数输入端的信号和/或计数输出端的信号;延迟单元包括至少一个第二触发器;第二触发器以时钟脉冲作为控制信号,接收前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至后一级子计数器;数据对齐模块包括至少一个第三触发器,数据对齐模块基于第三触发器进行数据对齐;数据对齐模块包括与多个子计数器对应的多条线路,多条线路中的每条线路接收对应的子计数器的计数输出信号;对于多条线路中的接收的计数输出信号为计数输出端的信号的线路,该条线路上级联的第三触发器的数量与计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量相等;对于多条线路中的接收的计数输出信号为计数输入端的信号的线路,该条线路上级联的第三触发器的数量等于计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量加1。In a more specific optional embodiment, the sub-counter is an n-bit counter, where n is greater than or equal to 1; each bit in the n-bit counter includes a first flip-flop; the first flip-flop includes a counting input terminal and counting output terminal; the counting output signal includes the signal of the counting input terminal and/or the signal of the counting output terminal; the delay unit includes at least one second flip-flop; the second flip-flop uses the clock pulse as the control signal to receive the previous stage sub-counter The carry output signal and the delayed carry output signal are output to the subsequent sub-counter; the data alignment module includes at least one third flip-flop, and the data alignment module performs data alignment based on the third flip-flop; the data alignment module includes and multiple sub-counters Corresponding multiple lines, each line in the multiple lines receives the counting output signal of the corresponding sub-counter; for the line in which the received counting output signal is the signal of the counting output terminal, the cascaded third line on the line The number of three flip-flops is equal to the number of second flip-flops in the counting module from the sub-counter corresponding to the line to the last sub-counter; for the counting output signal received in multiple lines, it is the signal of the counting input terminal line, the number of third flip-flops cascaded on this line is equal to the number of second flip-flops in the counting module from the sub-counter corresponding to the line to the last sub-counter plus 1.
可以理解的,图6以4个子计数器级联为例示出,并且每个子计数器采用4bit计数器,从而实现16bit计数器。其中,4个4bit计数器分成4级流水结构;因此,计数模块也可以称为“流水线计数器核心”。当然,本申请实施例并不限于此,流水线计数器核心可以包括多个n bit计数器;各子计数器的位数可以相同,也可以不同。It can be understood that Figure 6 shows a cascade of four sub-counters as an example, and each sub-counter uses a 4-bit counter, thereby realizing a 16-bit counter. Among them, 4 4-bit counters are divided into 4-level pipeline structure; therefore, the counting module can also be called "pipeline counter core". Of course, the embodiments of the present application are not limited to this. The pipeline counter core may include multiple n-bit counters; the number of bits in each sub-counter may be the same or different.
第一级子计数器的进位输出信号经过一个触发器拍齐,进入第二级流水参与计数运算。第二级子计数器的进位输出信号又经过一个触发器之后参与第三级运算,以此类推。最终,每一级子计数器产生4bit的DA和DS。可以知道,当第一级子计数器的进位输出信号产生的时候,其需要经过一个时钟周期才会参与到第二级的运算。而这个进位输出信号在经过第二级流水处理之后,又经过了一个触发器,才进入第三级参与运算。在第三级之后,还要经过一级触发器才能进行最终第四级的运算,最后输出。因此,第一级子计数器的计数结果(计数输出信号),最终要经过三个额外的触发器才能完成运算。这就说明,第一级子计数器的计数是比最后一级子计数器的计数结果提前3个周期传输至数据对齐模块的。因此,在最终进行数据对齐的时候,需要让第一级子计数器的DS<3:0>延迟三个时钟周期之后才能作为最终输出的计数结果的一部分,与其他子计数器输出的计数输出信号进行拼合。同理,第二级子计数器的DS<7:4>要经过两个时钟周期的延时;第三级子计数器要经过一个时钟周期的延时。如此,在数据对齐模块中,接收第一级子计数器的DS<3:0>的线路上级联三个第三触发器;接收第二级子计数器的DS<7:4>的线路上级联两个第三触发器;接收第三级子计数器的DS<11:8>的线路上级联一个第三触发器。The carry output signals of the first-level sub-counter are snapped together by a flip-flop and enter the second-level pipeline to participate in the counting operation. The carry output signal of the second-level sub-counter passes through a flip-flop and then participates in the third-level operation, and so on. Finally, each sub-counter generates 4 bits of DA and DS. It can be known that when the carry output signal of the first-level sub-counter is generated, it takes one clock cycle before it participates in the second-level operation. After the carry output signal passes through the second stage of pipeline processing, it passes through a flip-flop before entering the third stage to participate in the operation. After the third level, a level of flip-flop is required to perform the final fourth level operation and final output. Therefore, the counting result of the first-level sub-counter (counting output signal) ultimately needs to go through three additional flip-flops to complete the operation. This means that the count of the first-level sub-counter is transmitted to the data alignment module 3 cycles earlier than the count result of the last-level sub-counter. Therefore, when the data is finally aligned, DS<3:0> of the first-level sub-counter needs to be delayed by three clock cycles before it can be used as part of the final output counting result and matched with the counting output signals output by other sub-counters. Piece together. In the same way, DS<7:4> of the second-level sub-counter needs to go through a delay of two clock cycles; the third-level sub-counter needs to go through a delay of one clock cycle. In this way, in the data alignment module, three third flip-flops are cascaded on the line that receives DS<3:0> of the first-level sub-counter; two third flip-flops are cascaded on the line that receives DS<7:4> of the second-level sub-counter. A third flip-flop; a third flip-flop is cascaded on the line receiving DS<11:8> of the third-level sub-counter.
而对于第四级子计数器,作为一种可选的实施方式,可以与前几级子计数器类似,将第四级子计数器的DS<15:9>输出至数据对齐模块,从而不需要经过延时,直接作为计数结果的一部分输出;相应的,接收第四级子计数器的DS<15:9>的线路上无需级联第三触发器。但是,作为另一种可选的实施方式,最后一级(在本实施方式中具体为第四级)子计数器最好也经过一个触发器,即接收最后一级子计数器的计数输出信号的线路上级联一个第三触发器。如此,可以保证最终输出的计数结果是由同步时钟触发的(同步时序计数器的要求),避免最后一级计数器的DS采用CLOCK1来驱动的,而输出的计数结果是用CLOCK2驱动,产生不同步的问题。对于在接收最后一级子计数器的计数输出信号的线路上级联一个第三触发器的实施方式,采用DA<15:9>作为最终的输出,而不是DS<15:9>。As for the fourth-level sub-counter, as an optional implementation method, similar to the previous sub-counters, the DS<15:9> of the fourth-level sub-counter can be output to the data alignment module, so that no delay is required. When , it is directly output as part of the counting result; accordingly, there is no need to cascade the third flip-flop on the line receiving DS<15:9> of the fourth-level sub-counter. However, as another optional implementation, the last stage (specifically the fourth stage in this implementation) sub-counter preferably also passes through a flip-flop, that is, a line that receives the counting output signal of the last stage sub-counter. A third flip-flop is cascaded up. In this way, it can be ensured that the final output counting result is triggered by the synchronous clock (requirement of the synchronous sequence counter), avoiding that the DS of the last stage counter is driven by CLOCK1, and the output counting result is driven by CLOCK2, resulting in asynchronous question. For the implementation in which a third flip-flop is cascaded on the line that receives the count output signal of the last stage sub-counter, DA<15:9> is used as the final output instead of DS<15:9>.
可选的,多条线路中与计数模块中最后一级子计数器对应的线路,接收的计数输出信号为计数输入端的信号。如此,对于多条线路中的接收的计数输出信号为计数输入端的信号的线路,该条线路上级联的第三触发器的数量等于计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量加1;具体对于最后一级子计数器而言,其后面没有第二触发器,即数量为0,与其对应的线路上级联的第三触发器的数量等于0+1,即连接一个第三触发器。Optionally, the counting output signal received by the line corresponding to the last sub-counter in the counting module among the multiple lines is the signal of the counting input terminal. In this way, for a line among multiple lines in which the received counting output signal is a signal at the counting input terminal, the number of third flip-flops cascaded on the line is equal to the number of the counting module from the sub-counter corresponding to the line to the last sub-counter. The number of second flip-flops between counters is increased by 1; specifically for the last sub-counter, there is no second flip-flop behind it, that is, the number is 0, and the number of third flip-flops cascaded on its corresponding line is equal to 0+1, that is, connect a third flip-flop.
可选的,计数输出信号包括计数输入端的信号和计数输出端的信号;多条线路中除与最后一级子计数器对应的线路以外的其他线路,接收的计数输出信号为计数输出端的信号。如此,一方面保证了最终输出的计数结果是由同步时钟触发,另一方面尽可能节省了触发器的设置数量,降低器件成本。Optionally, the counting output signal includes the signal of the counting input terminal and the signal of the counting output terminal; among the multiple lines, except for the line corresponding to the last stage sub-counter, the counting output signal received is the signal of the counting output terminal. In this way, on the one hand, it is ensured that the final output counting result is triggered by the synchronous clock, on the other hand, the number of flip-flop settings is saved as much as possible and the device cost is reduced.
应当理解,本申请实施例不限于此,多条线路中与计数模块中除最后一级以外的其他级子计数器对应的线路,接收的计数输出信号也可以为计数输入端的信号,也应被认为是可行的。It should be understood that the embodiments of the present application are not limited to this. Among the multiple lines corresponding to other sub-counters except the last stage in the counting module, the received counting output signal can also be the signal of the counting input terminal, and should also be considered. It works.
接下来,请结合图1、图5及图6,本申请实施例提供的计数器还可以包括时钟模块,该时钟模块用于产生第一时钟信号和第二时钟信号,计数模块基于第一时钟信号工作,数据对齐模块基于第二时钟信号 工作。Next, please combine Figure 1, Figure 5 and Figure 6. The counter provided by the embodiment of the present application can also include a clock module. The clock module is used to generate a first clock signal and a second clock signal. The counting module is based on the first clock signal. To work, the data alignment module works based on the second clock signal.
如图5所示,时钟模块包括时钟信号输入端(请参考图中CLOCK)、第一时钟信号输出端(请参考图中CLOCK1)和第二时钟信号输出端(请参考图中CLOCK2)。时钟模块主要是根据时钟信号输入端输入的时钟信号,生成供计数模块和数据对齐模块使用的第一时钟信号和第二时钟信号。As shown in Figure 5, the clock module includes a clock signal input terminal (please refer to CLOCK in the figure), a first clock signal output terminal (please refer to CLOCK1 in the figure), and a second clock signal output terminal (please refer to CLOCK2 in the figure). The clock module mainly generates the first clock signal and the second clock signal for use by the counting module and the data alignment module based on the clock signal input from the clock signal input terminal.
第一时钟信号和第二时钟信号之间的相位差可以根据实际情况设定。具体地,这两个时钟信号的相位关系可以根据实现计数器的器件的延时来制定,从而确保有最大的时序余量。作为一种可选的实施方式,第一时钟信号和第二时钟信号也可以不存在相位差,两个时钟信号同步即可。作为另一种可选的实施方式,第一时钟信号和第二时钟信号之间存在相位差。可以理解的,有时候为了达到更高的速度,可以使得CLOCK2比CLOCK1快一些或者慢一些,从而争取足够的时序余量。The phase difference between the first clock signal and the second clock signal can be set according to actual conditions. Specifically, the phase relationship between the two clock signals can be formulated according to the delay of the device that implements the counter, thereby ensuring maximum timing margin. As an optional implementation manner, there may be no phase difference between the first clock signal and the second clock signal, and the two clock signals may be synchronized. As another optional implementation manner, there is a phase difference between the first clock signal and the second clock signal. It is understandable that sometimes in order to achieve a higher speed, CLOCK2 can be made faster or slower than CLOCK1, so as to achieve sufficient timing margin.
考虑到随着计数器位数的增加,同步时钟的驱动要求也会逐渐增加,这可能引起同步时钟的配合问题,如果各个触发器翻转不同时,则会出现计数错误的状况。因此,时钟模块除了具有调节第一时钟信号和第二时钟信号之间相位关系的作用,还需要考虑增加时钟的驱动能力。Considering that as the number of counter bits increases, the driving requirements of the synchronous clock will gradually increase, which may cause coordination problems with the synchronous clock. If the flip-flops of each flip-flop do not flip at the same time, counting errors will occur. Therefore, in addition to the function of adjusting the phase relationship between the first clock signal and the second clock signal, the clock module also needs to consider increasing the driving capability of the clock.
请参考图6,作为一种可选的实施方式,时钟模块包括时钟信号输入端以及与时钟信号输入端连接的第一时钟产生线路和第二时钟产生线路;第一时钟产生线路用于基于时钟信号输入端输入的时钟信号产生第一时钟信号;第二时钟产生线路用于基于时钟信号输入端输入的时钟信号产生第二时钟信号;第一时钟产生线路和/或第二时钟产生线路上连接有延迟单元。Please refer to Figure 6. As an optional implementation, the clock module includes a clock signal input terminal and a first clock generation line and a second clock generation line connected to the clock signal input terminal; the first clock generation line is used to generate a clock signal based on the clock signal input terminal. The clock signal input at the signal input terminal generates a first clock signal; the second clock generation line is used to generate a second clock signal based on the clock signal input at the clock signal input terminal; the first clock generation line and/or the second clock generation line are connected There are delay units.
图6中具体以第一时钟产生线路上连接有两个延迟单元(延迟单元1和延迟单元2)且第二时钟产生线路上连接有两个延迟单元(延迟单元3和延迟单元4)为例示出,共使用了四个延迟单元。Specifically, in Figure 6, two delay units (delay unit 1 and delay unit 2) are connected to the first clock generation line and two delay units (delay unit 3 and delay unit 4) are connected to the second clock generation line as an example. Out, a total of four delay units are used.
在可选的实施方式中,第一时钟产生线路和第二时钟产生线路上可以分别连接有至少两个延迟单元;从而与使用一个延迟单元相比,进一步增加相位调节的灵活性。并且,在线路上连接有两个以上延迟单元的情况下,位于后一级的延迟单元的扇出能力大于位于前一级的延迟单元的扇出能力;从而逐级扩大扇出能力,实现更强的驱动能力。In an optional implementation, at least two delay units may be connected to the first clock generation line and the second clock generation line respectively; thus, compared with using one delay unit, the flexibility of phase adjustment is further increased. Moreover, when there are more than two delay units connected on the line, the fan-out capability of the delay unit located at the next level is greater than the fan-out capability of the delay unit located at the previous level; thus, the fan-out capability is gradually expanded to achieve stronger driving ability.
本申请各实施例可以应用在高速码型发生器上。实施例采用流水线结构,每一级子计数器的进位bit输出之后经过一个触发器拍一拍,形成流水结构,用来抵消进位链的延迟;每一级子计数器会输出各自的DA和DS,数据对齐模块主要是接收流水线计数器输出的DS和DA的值,通过确定的时序关系,将隶属于同一计数周期的数据拼齐,形成最终输出。如此,解决了传统计数器结构进位链太长,导致进位产生的延时太长,进而制约计数器最高运行速度的问题。采用时钟树重新分配的方式,可以根据工艺器件自身的特性自由调配时钟相位关系,实现同一组工艺下计数器速度的最大化。Each embodiment of the present application can be applied to a high-speed pattern generator. The embodiment adopts a pipeline structure. After the carry bit of each sub-counter is output, it is clicked by a flip-flop to form a pipeline structure to offset the delay of the carry chain; each sub-counter will output its own DA and DS, data The alignment module mainly receives the DS and DA values output by the pipeline counter, and through the determined timing relationship, aligns the data belonging to the same counting cycle to form the final output. In this way, the problem that the carry chain of the traditional counter structure is too long causes the carry delay to be too long, thereby restricting the maximum operating speed of the counter. Using clock tree redistribution, the clock phase relationship can be freely adjusted according to the characteristics of the process device itself, maximizing the counter speed under the same set of processes.
本申请各实施例可以在不改变使用的数字标准器件的基础上,实现计数器运行速度的大提升,功能和成本上具有很大意义。Each embodiment of the present application can achieve a great improvement in the running speed of the counter without changing the digital standard device used, which is of great significance in terms of function and cost.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined in any way. To simplify the description, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, All should be considered to be within the scope of this manual.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present invention. The descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the scope of protection of the patent of the present invention should be determined by the appended claims.

Claims (11)

  1. 一种计数器,其特征在于,包括:A counter, characterized in that it includes:
    计数模块,包括多个级联的子计数器和连接在多个所述子计数器中至少两个相邻的子计数器之间的延迟单元;其中,所述子计数器用于对时钟脉冲的个数进行计数以输出计数输出信号和进位输出信号;所述延迟单元用于接收所述至少两个子计数器中前一级子计数器的进位输出信号,并将接收到的所述进位输出信号进行延迟后输出至后一级子计数器;A counting module includes a plurality of cascaded sub-counters and a delay unit connected between at least two adjacent sub-counters in the plurality of sub-counters; wherein the sub-counters are used to count the number of clock pulses. Count to output a count output signal and a carry output signal; the delay unit is used to receive the carry output signal of the previous sub-counter in the at least two sub-counters, and delay the received carry output signal before outputting it to The next level sub-counter;
    数据对齐模块,用于接收多个所述子计数器的计数输出信号,并按照与所述延迟单元导致的延迟时间对应的关系将接收到的属于同一个计数周期的多个所述计数输出信号进行数据对齐,以输出计数结果。A data alignment module, configured to receive counting output signals of multiple sub-counters, and align the received multiple counting output signals belonging to the same counting cycle according to the relationship corresponding to the delay time caused by the delay unit. Data alignment to output count results.
  2. 根据权利要求1所述的计数器,其特征在于,所述多个子计数器中每相邻两级子计数器之间设置有一延迟单元。The counter according to claim 1, wherein a delay unit is provided between every two adjacent sub-counters in the plurality of sub-counters.
  3. 根据权利要求1或2所述的计数器,其特征在于,所述延迟单元包括触发器,所述触发器以时钟脉冲作为控制信号,接收所述前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至所述后一级子计数器。The counter according to claim 1 or 2, characterized in that the delay unit includes a flip-flop, which uses a clock pulse as a control signal to receive the carry output signal of the previous stage sub-counter and output the delayed The carry output signal is sent to the subsequent sub-counter.
  4. 根据权利要求1所述的计数器,其特征在于,至少一所述子计数器为n位(n bit)计数器,其中,n大于1;所述n位计数器中的各位之间通过与门产生进位信号;The counter according to claim 1, characterized in that at least one of the sub-counters is an n-bit (n-bit) counter, where n is greater than 1; a carry signal is generated between each bit in the n-bit counter through an AND gate. ;
    所述n位计数器中至少一位的与门的输入端与上一位的与门的输入端相连;The input end of at least one AND gate in the n-bit counter is connected to the input end of the previous one-bit AND gate;
    所述n位计数器中包括不超过一位的与门采用如下连接方式:该位的与门的输入端与上一位的与门的输出端相连。The n-bit counter including no more than one AND gate adopts the following connection method: the input end of the AND gate of this bit is connected to the output end of the previous bit AND gate.
  5. 根据权利要求1所述的计数器,其特征在于,所述数据对齐模块包括触发器,所述数据对齐模块基于所述触发器进行数据对齐。The counter according to claim 1, wherein the data alignment module includes a flip-flop, and the data alignment module performs data alignment based on the flip-flop.
  6. 根据权利要求1所述的计数器,其特征在于,The counter according to claim 1, characterized in that:
    所述子计数器为n位(n bit)计数器,其中,n大于等于1;所述n位计数器中的每一位包括一个第一触发器;所述第一触发器包括计数输入端以及计数输出端;所述计数输出信号包括所述计数输入端的信号和/或所述计数输出端的信号;The sub-counter is an n-bit counter, where n is greater than or equal to 1; each bit in the n-bit counter includes a first flip-flop; the first flip-flop includes a counting input terminal and a counting output terminal; the counting output signal includes the signal of the counting input terminal and/or the signal of the counting output terminal;
    所述延迟单元包括至少一个第二触发器;所述第二触发器以时钟脉冲作为控制信号,接收所述前一级子计数器的进位输出信号以及输出延迟后的进位输出信号至所述后一级子计数器;The delay unit includes at least one second flip-flop; the second flip-flop uses a clock pulse as a control signal to receive the carry output signal of the previous sub-counter and output the delayed carry output signal to the subsequent sub-counter. Level sub counter;
    所述数据对齐模块包括至少一个第三触发器,所述数据对齐模块基于所述第三触发器进行数据对齐;The data alignment module includes at least one third flip-flop, and the data alignment module performs data alignment based on the third flip-flop;
    所述数据对齐模块包括与多个所述子计数器对应的多条线路,所述多条线路中的每条线路接收对应的子计数器的计数输出信号;The data alignment module includes a plurality of lines corresponding to a plurality of the sub-counters, and each line in the plurality of lines receives a counting output signal of a corresponding sub-counter;
    对于所述多条线路中的接收的计数输出信号为计数输出端的信号的线路,该条线路上级联的所述第三触发器的数量与所述计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量相等;For a line among the plurality of lines in which the received counting output signal is a signal at a counting output terminal, the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line. The number of second flip-flops to the last sub-counter is equal;
    对于所述多条线路中的接收的计数输出信号为计数输入端的信号的线路,该条线路上级联的所述第三触发器的数量等于所述计数模块中从与该条线路对应的子计数器到最后一个子计数器之间的第二触发器的数量加1。For a line among the plurality of lines in which the received counting output signal is a signal at the counting input end, the number of the third flip-flops cascaded on the line is equal to the number of sub-counters in the counting module corresponding to the line. The number of second flip-flops to the last sub-counter is incremented by one.
  7. 根据权利要求6所述的计数器,其特征在于,所述多条线路中与所述计数模块中最后一级子计数器对应的线路,接收的计数输出信号为计数输入端的信号。The counter according to claim 6, wherein the counting output signal received by the line corresponding to the last stage sub-counter in the counting module among the plurality of lines is the signal of the counting input terminal.
  8. 根据权利要求7所述的计数器,其特征在于,所述计数输出信号包括所述计数输入端的信号和所述计数输出端的信号;所述多条线路中除与所述最后一级子计数器对应的线路以外的其他线路,接收的计数输出信号为计数输出端的信号。The counter according to claim 7, wherein the counting output signal includes a signal of the counting input terminal and a signal of the counting output terminal; among the plurality of lines, except for the signal corresponding to the last stage sub-counter For lines other than the line, the counting output signal received is the signal at the counting output terminal.
  9. 根据权利要求1所述的计数器,其特征在于,还包括时钟模块,The counter according to claim 1, further comprising a clock module,
    所述时钟模块用于产生第一时钟信号和第二时钟信号,所述计数模块基于所述第一时钟信号工作,所述数据对齐模块基于所述第二时钟信号工作。The clock module is used to generate a first clock signal and a second clock signal, the counting module operates based on the first clock signal, and the data alignment module operates based on the second clock signal.
  10. 根据权利要求9所述的计数器,其特征在于,所述时钟模块包括时钟信号输入端以及与所述时钟信号输入端连接的第一时钟产生线路和第二时钟产生线路;所述第一时钟产生线路用于基于所述时钟信号输入端输入的时钟信号产生所述第一时钟信号;所述第二时钟产生线路用于基于所述时钟信号输入端输入的时钟信号产生所述第二时钟信号;所述第一时钟产生线路和/或所述第二时钟产生线路上连接有延迟单 元。The counter according to claim 9, wherein the clock module includes a clock signal input terminal and a first clock generation circuit and a second clock generation circuit connected to the clock signal input terminal; the first clock generation circuit The circuit is used to generate the first clock signal based on the clock signal input by the clock signal input terminal; the second clock generation circuit is used to generate the second clock signal based on the clock signal input by the clock signal input terminal; A delay unit is connected to the first clock generation line and/or the second clock generation line.
  11. 根据权利要求10所述的计数器,其特征在于,所述第一时钟产生线路和所述第二时钟产生线路上分别连接有至少两个延迟单元,并且位于后一级的延迟单元的扇出能力大于位于前一级的延迟单元的扇出能力。The counter of claim 10, wherein at least two delay units are respectively connected to the first clock generation line and the second clock generation line, and the delay unit at the subsequent stage has a fan-out capability of Greater than the fan-out capability of the delay unit located at the previous stage.
PCT/CN2022/130232 2022-07-28 2022-11-07 Counter WO2024021360A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210897992.7 2022-07-28
CN202210897992.7A CN115189691A (en) 2022-07-28 2022-07-28 Counter with a counter body

Publications (1)

Publication Number Publication Date
WO2024021360A1 true WO2024021360A1 (en) 2024-02-01

Family

ID=83521066

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/130232 WO2024021360A1 (en) 2022-07-28 2022-11-07 Counter

Country Status (2)

Country Link
CN (1) CN115189691A (en)
WO (1) WO2024021360A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115189691A (en) * 2022-07-28 2022-10-14 普源精电科技股份有限公司 Counter with a counter body
CN117595860A (en) * 2023-11-15 2024-02-23 合芯科技有限公司 Counter, memory and chip

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5706322A (en) * 1995-05-11 1998-01-06 E-Systems, Inc. Precision time of day counter
CN203104406U (en) * 2012-12-24 2013-07-31 上海集成电路研发中心有限公司 Asynchronous counter
CN106227026A (en) * 2016-09-05 2016-12-14 中国科学院国家授时中心 A kind of time-interval counter of pair of delay interpolation method
CN115189691A (en) * 2022-07-28 2022-10-14 普源精电科技股份有限公司 Counter with a counter body

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5706322A (en) * 1995-05-11 1998-01-06 E-Systems, Inc. Precision time of day counter
CN203104406U (en) * 2012-12-24 2013-07-31 上海集成电路研发中心有限公司 Asynchronous counter
CN106227026A (en) * 2016-09-05 2016-12-14 中国科学院国家授时中心 A kind of time-interval counter of pair of delay interpolation method
CN115189691A (en) * 2022-07-28 2022-10-14 普源精电科技股份有限公司 Counter with a counter body

Also Published As

Publication number Publication date
CN115189691A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
WO2024021360A1 (en) Counter
US6150965A (en) Serial to parallel converter enabled by multiplexed flip-flop counters
KR100936445B1 (en) High speed serializing-deserializing system and method
CN108736897B (en) Parallel-serial conversion circuit and device applied to high-speed interface physical layer chip
CN110083563B (en) Arbitration circuit for realizing fair arbitration based on cyclic priority
JPH0654875B2 (en) Parallel / serial data synchronous conversion circuit
TW200926600A (en) Clockless serialization using delay circuits
CN101087141B (en) Idle percent adjustable N-time frequency division circuit of pulse synthesis mode
CN104579320A (en) Clock delay method, clock delay device, delay-locked loop and digital clock management unit
JP2024515147A (en) Synchronous divider based on cascaded retiming
US3967205A (en) Frequency dividing network with odd integral step-down ratio
CN113300799B (en) Clock synchronization method, circuit and logic device suitable for JESD204B protocol
US3440547A (en) Synchronizer for modifying the advance of timing wave countdown circuits
CN105306022A (en) Asymmetric time-delay apparatus used for asynchronous circuit four-phase handshake protocol
JPH01220913A (en) Digital event generator
CN1321500C (en) High speed synchronous counter
KR960006466B1 (en) Data retiming circuit of transmission system
CN116700431B (en) Event-driven clock generation method and device, chip and electronic equipment
TWI835234B (en) Entropy source circuit
CN113114187B (en) Asynchronous pulse transmission blocking unit, control method thereof and superconducting single-flux quantum circuit
CN100452686C (en) Parallel frame alignment circuit applied to optical synchronous digital transferring system
CN209879362U (en) Reverse clock generation circuit without low level intersection
JP3513399B2 (en) Variable timing device using serial data
CN117833909A (en) Half-integer frequency dividing system and frequency divider
SU1541776A1 (en) Counter

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

Country of ref document: EP

Kind code of ref document: A1