Gray code counter

By designing auxiliary units and an initial counter, combined with a series successor counter, the logic structure of the Gray code counter is simplified, solving the problems of design complexity and stability in existing technologies. This results in a Gray code counter with high stability and low complexity, suitable for highly integrated and low-power integrated circuits.

CN118316440BActive Publication Date: 2026-11-17UNITED MICROELECTRONICS CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410415122.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2026-11-17
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

Existing synchronous Gray code counter designs are complex and difficult to optimize, while asynchronous Gray code counters have poor stability. It is difficult to simplify the design while ensuring stability and accuracy, which is especially challenging in modern integrated circuits with high integration and low power consumption.

Method used

The design employs an auxiliary unit and an initial counter. The auxiliary unit includes a zero-level D flip-flop, and the initial counter consists of a primary NOT gate, a primary two-input NOR gate, a primary two-input XOR gate, and a primary D flip-flop. The output of the auxiliary unit controls the flipping of the initial counter, and the successor counter is cascaded in series to simplify the logic structure.

Benefits of technology

It achieves high stability, strong scalability, and simple logic in Gray code counters, reducing circuit complexity and wiring resource consumption. It supports the stability and uniqueness of high-bit output, making it suitable for high-precision signal processing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118316440B_ABST
    Figure CN118316440B_ABST
Patent Text Reader

Abstract

This application provides a Gray code counter, belonging to the technical field of integrated circuit design. The Gray code counter includes an auxiliary unit and an initial counter; wherein the auxiliary unit includes a zero-level D flip-flop; the initial counter includes a primary NOT gate, a primary two-input NOR gate, a primary two-input XOR gate, and a primary D flip-flop, which are electrically connected sequentially from input to output; and any input of the primary two-input NOR gate is electrically connected to the clock of the zero-level D flip-flop. This counter achieves clear logic, simple structure, and stable output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of integrated circuit design, and more specifically, to a Gray code counter. Background Technology

[0002] Integrated circuits, as a core component of modern electronic information technology, play a crucial role in many fields such as data processing, communication transmission, and automatic control. Gray code counters, as a special type of digital circuit, have wide applications in situations requiring precise and error-free transitions, such as position detection and stepper motor control, due to their unique encoding characteristics (only one bit changes between adjacent codewords). Synchronous Gray code counters are an implementation method that updates strictly in sync with the system clock and are commonly used in high-precision and high-speed signal processing systems.

[0003] Currently, the common approach to designing synchronous Gray code counters is to combine a binary counter with Gray code generation logic. However, due to the transient states inherent in binary counters, this method is detrimental to the stability and uniqueness of the output Gray code. Furthermore, while this method ensures synchronous counting, the design involves multiple flip-flops and complex logic transitions, resulting in high design complexity and significant wiring resource consumption. Asynchronous Gray code counters have also been proposed in related technologies. Although they can reduce the requirement for a synchronous clock in certain applications, their internal state transitions rely on asynchronous changes in external signals, often leading to stability issues such as susceptibility to glitches and difficulty in ensuring error-free continuous counting.

[0004] However, existing synchronous Gray code counter designs are complex and difficult to optimize, especially in modern integrated circuit designs that pursue higher integration and lower power consumption. This complexity not only increases design costs but may also affect the overall system reliability and performance. On the other hand, although asynchronous Gray code counters can simplify timing constraints to some extent, their inherent instability often fails to meet the stringent requirements for long-term stable operation and anti-interference capabilities in practical applications. Therefore, how to simplify the design of synchronous Gray code counters while ensuring the stability and accuracy of Gray code counting has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] A brief overview of this application is provided below to offer a basic understanding of certain aspects thereof. However, it should be understood that this overview is not an exhaustive summary of the application, nor is it intended to identify any key or essential parts of the application, nor is it intended to limit the scope of the application. The purpose of this overview is merely to present some inventive concepts of the application in a simplified form as a prelude to the more detailed description that follows.

[0006] In view of the technical problem that Gray code counters in the prior art are difficult to reduce complexity while ensuring stability and accuracy, the purpose of this application is to provide a Gray code counter, which includes an auxiliary unit and an initial counter;

[0007] The auxiliary unit includes a zero-level D flip-flop;

[0008] The initial counter includes a primary NOT gate, a primary two-input NOR gate, a primary two-input XNOR gate, and a primary D flip-flop, which are electrically connected sequentially from input to output; and...

[0009] Either input of the primary two-input NOR gate is electrically connected to the clock of the zero-level D flip-flop.

[0010] Optionally, when the number of bits M in the Gray code is greater than or equal to 2, the Gray code counter further includes M-1 continuation counters; the M-1 continuation counters are cascaded sequentially as the number of bits M in the Gray code increases.

[0011] Each of the M-1 repeating counters includes an m-th stage two-input OR gate, an m-th stage two-input NOR gate, an m-th stage XOR gate, and an m-th stage D flip-flop connected sequentially from the input to the output; and 2≤m≤M.

[0012] Optionally, when m=2, any one of the input terminals of the m-th level two-input OR gate is electrically connected to the input terminal of the primary NOT gate;

[0013] When m > 2, any one of the input terminals of the m-th stage two-input OR gate is electrically connected to the output segment of the (m-1)-th stage two-input OR gate.

[0014] Optionally, the output logic of the Gray code counter satisfies:

[0015]

[0016]

[0017] Y = CLK + Q0(n);

[0018] Where Q0(n) is the state of the auxiliary unit at time n; Q0(n+1) is the state of the auxiliary unit at time n+1; n is any time; Y is the result of all logic operations at one input of the XNOR gate; CLK is the clock signal, ↑ represents the rising edge, and ↓ represents the falling edge.

[0019] Optionally, the output logic of the Gray code counter also satisfies:

[0020]

[0021] Y = Y m-1 +Qm-1(n);

[0022]

[0023] 2≤m≤M;

[0024] Where Ym-1 represents the logical operation result of the m-th stage OR gate; Y represents all logical operation results of one input of the XNOR gate, which triggers the output of this stage (m-bit Gray code); Qm(n) represents the state of the m-th stage circuit at time n; Qm(n+1) represents the state of the m-th stage circuit at time n+1; n is any time.

[0025] Optionally, the zero-level D flip-flop is configured to be triggered on the falling edge, and the primary D flip-flop is configured to be triggered on the rising edge.

[0026] Optionally, the m-th stage D flip-flop is configured to be triggered on the rising edge.

[0027] Optionally, the minimum period of the output of the auxiliary unit includes two CLK periods;

[0028] Furthermore, the minimum period is half the period of the output of the initial counter.

[0029] Optionally, the zero-level D flip-flop and the primary D flip-flop receive the same clock signal.

[0030] Optionally, the zero-level D flip-flop, the primary D flip-flop, and the m-th level D flip-flop receive the same clock signal.

[0031] Optionally, the initial counter further includes an expansion module; and / or,

[0032] Any one or more of the M-1 repeater counters also include an expansion module.

[0033] Optionally, the expansion module is electrically connected to the input terminal of the initial counter; or,

[0034] The expansion module is electrically connected to the input terminal of the last of the M-1 succession counters.

[0035] The above-mentioned technical solution of this application has achieved at least the following beneficial effects:

[0036] The Gray code counter provided in this application includes an auxiliary unit and an initial counter. The auxiliary unit includes a zero-level D flip-flop. The initial counter includes a primary NOT gate, a primary two-input NOR gate, a primary two-input XOR gate, and a primary D flip-flop connected sequentially from input to output. Each input of the primary two-input NOR gate is electrically connected to the clock of the zero-level D flip-flop. The output of the auxiliary unit controls the flipping of the initial counter. The counter provided in this application has simple logic, and the high-order output is composed of the low-order output, exhibiting high stability and strong scalability. Attached Figure Description

[0037] The accompanying drawings are provided to further understand this application and are incorporated in and form a part of this specification. The drawings illustrate embodiments of this application and, together with the following description, serve to explain the principles of this application.

[0038] Figure 1 An optional circuit diagram of an auxiliary unit for a Gray code counter provided in an embodiment of this application is shown.

[0039] Figure 2 An optional circuit diagram of the initial counter of the Gray code counter provided in an embodiment of this application is shown.

[0040] Figure 3 An optional four-bit Gray code counter state change table is shown.

[0041] Figure 4 A state change table of a one-bit counter provided in an embodiment of this application is shown.

[0042] Figure 5 A state change table of the continue counter provided in an embodiment of this application is shown.

[0043] Figure 6 (a) shows an optional circuit diagram of the succession counter of the Gray code counter provided in an embodiment of this application.

[0044] Figure 6 (b) shows an optional circuit diagram of the succession counter of the Gray code counter provided in an embodiment of this application.

[0045] Figure 7 A state change table for another repeater counter provided in this application is shown.

[0046] Figure 8 An optional circuit diagram of another successor counter of the Gray code counter provided in an embodiment of this application is shown.

[0047] Figure 9 An optional circuit diagram of another successor counter of the Gray code counter provided in an embodiment of this application is shown.

[0048] Figure 10 An optional internal circuit diagram of a 14-bit Gray code counter provided in an embodiment of this application is shown.

[0049] Figure 11 An optional internal circuit diagram of a 14-bit Gray code counter in the related art is shown.

[0050] Figure 12 An optional circuit diagram of the low-order portion of the extension module of the Gray code counter provided in an embodiment of this application is shown.

[0051] Figure 13 An optional circuit diagram of the high-order portion of the extension module of the Gray code counter provided in an embodiment of this application is shown.

[0052] Figure 14 An optional top-level circuit diagram of a 10-bit Gray code counter provided in an embodiment of this application is shown.

[0053] Figure 15 It shows Figure 12 The diagram shows an optional internal circuit diagram of a 10-bit Gray code counter.

[0054] Figure 16 It shows Figure 12 The simulation results of the positive phase output of the 10-bit Gray code counter are shown.

[0055] Figure 17 It shows Figure 14 The simulation results of the inverted output of the 10-bit Gray code counter are shown.

[0056] Figure 18 It shows Figure 14 The simulation results of setting and resetting the 10-bit Gray code counter are shown.

[0057] Figure 19 An optional top-level circuit diagram of a 10-bit Gray code counter provided in an embodiment of this application is shown.

[0058] Figure 20 It shows Figure 18 The diagram shows the internal circuitry of a 10-bit Gray code counter.

[0059] Figure 21 An optional top-level circuit diagram of two 10-bit Gray code counters connected in series, as provided in an embodiment of this application, is shown.

[0060] Figure 22 The simulation results of bits 1 to 9 of two 10-bit Gray code counters cascaded together, as provided in the embodiments of this application, are shown.

[0061] Figure 23 The simulation results of 10 to 18 bits of two 10-bit Gray code counters cascaded together, as provided in the embodiments of this application, are shown. Detailed Implementation

[0062] In this specification, it will also be understood that when a component (or region, layer, part, etc.) is referred to relative to other components, such as "on," "connected to," or "coupled to" other components, that component may be directly disposed on / directly connected to / directly coupled to that component, or there may be an intervening third component. Conversely, when a component (or region, layer, part, etc.) is referred to relative to other components in this specification, such as "directly" on, "directly connected to," or "directly coupled to" other components, there is no intervening component between them.

[0063] The present application will now be described more fully below with reference to the accompanying drawings, in which various embodiments are illustrated. However, the present application may be implemented in many different ways and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present application will be exhaustive and complete, and will fully convey the scope of the present application to those skilled in the art. The same reference numerals denote the same parts throughout the drawings. Furthermore, in the drawings, the thickness, proportions, and dimensions of parts are enlarged for clarity.

[0064] The terminology used herein is for descriptive purposes only and is not intended to be limiting. Unless the context clearly indicates otherwise, the terms “a,” “an,” “the,” and “at least one” as used herein are not intended to limit the quantity but are intended to include both the singular and the plural. For example, unless the context clearly indicates otherwise, “a component” has the same meaning as “at least one component.” “At least one” should not be construed as limiting “a” or “an.” “Or” means “and / or.” The term “and / or” includes any and all combinations of one or more of the associated listed items.

[0065] It will be understood that although terms such as “first” and “second” are used herein to describe various components, these components should not be limited by these terms. These terms are used only to distinguish one component from others. For example, a first component referred to as a first component in one embodiment may be referred to as a second component in other embodiments without departing from the scope of the appended claims.

[0066] Furthermore, terms such as "below," "below," "above," and "upper" are used to describe the relationships between the components shown in the diagram. These terms can be relative concepts and are described based on the directions presented in the diagram.

[0067] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art. Terms defined in commonly used dictionaries shall be interpreted as having the same meaning as in the relevant technical context, and shall not be interpreted as having a formal meaning in an idealized or overly formal sense unless expressly defined in the specification.

[0068] The meaning of “includes” or “contains” is to specify a nature, quantity, step, operation, element, component, or combination thereof, but does not exclude other natures, quantities, steps, operations, elements, components, or combinations thereof.

[0069] This document describes embodiments with reference to cross-sectional views of schematic diagrams as idealized implementations. Thus, variations in shape relative to the illustrations are anticipated as a result of, for example, manufacturing techniques and / or tolerances. Therefore, the embodiments described herein should not be construed as limited to the specific shapes of the regions shown herein, but should include deviations in shape due to, for example, manufacturing processes. For example, regions shown or described as flat may typically have rough and / or non-linear characteristics. Furthermore, acute angles shown may be rounded. Therefore, the regions shown in the figures are schematic in nature, and their shapes are not intended to show precise shapes of the regions and are not intended to limit the scope of the claims. Terms such as “substantially,” “approximately,” “about,” etc., as used herein, are intended to include variations of ±10%, ±9%, ±8%, ±7%, ±6%, ±5%, ±4%, ±3%, ±2%, or ±1% of the stated values.

[0070] In the following description, exemplary embodiments according to this application will be described with reference to the accompanying drawings.

[0071] Typically, Gray code counters with fewer bits can be implemented using Karnaugh maps to build JK flip-flops and gate circuits. However, the derivation logic of this method is complex and not suitable for implementing counters with more bits. On the other hand, Gray code counters with more bits are mainly implemented using Verilog HDL description methods. However, there are various ways to implement them using Verilog programming, and the schematic diagrams generated by the software are quite complex. Without theoretical analysis, it is difficult for scholars to identify the advantages and disadvantages of different models.

[0072] In view of the above issues, see Figure 1 and Figure 2 This application provides a Gray code counter. The Gray code counter includes an auxiliary unit and a primary counter. Specifically, as shown... Figure 1 As shown, the auxiliary unit includes a D flip-flop, referred to in this paper as a zero-level D flip-flop. Figure 2As shown, the primary counter includes a primary NOT gate, a primary two-input NOR gate, a primary two-input XOR gate, and a primary D flip-flop, which are electrically connected sequentially from input to output. Furthermore, any input of the primary two-input NOR gate is electrically connected to the clock of the zero-level D flip-flop. Thus, the clock of the zero-level D flip-flop is used as the master clock to synchronously control the flip-flop's movement. Based on the output of the auxiliary unit, the derivation of the primary counter is realized, achieving a one-bit Gray code output.

[0073] More specifically, Figure 3 The table in Table 1 exemplarily lists the state change table of an optional four-bit Gray code counter, where CLK is the clock signal, and Q1 to Q4 are the first to fourth bits of the Gray code, respectively. It is easy to see from Table 1 that within any two adjacent CLK cycles, only one bit of Q1 to Q4 changes in code value. In other words, compared to the Gray code of any CLK cycle, only one bit of the four-bit code value changes in any given CLK cycle. The minimum period of the m-th bit contains two periods of the (m-1)-th bit, where m ≥ 2. Furthermore, the minimum period of the m-th bit contains four periods of the (m-2)-th bit, where m ≥ 3. Additionally, as... Figure 3 As shown, the minimum period of the first code consists of 4 CLK periods.

[0074] According to the embodiments of this application, such as Figure 1 As shown, the Gray code counter provided in this application additionally introduces an intermediate output Q0, and makes the minimum period of Q0 include two CLK periods, and the minimum period of Q0 is half the minimum period of the first code Q1. The module corresponding to the intermediate output Q0 in the circuit is an auxiliary unit. Figure 2 As shown, the Gray code counter provided in this application achieves the output of the first Gray code by combining the state of the auxiliary unit with the logic of the primary counter. In some optional embodiments, the zero-level D flip-flop of the auxiliary unit is configured to be triggered on the falling edge.

[0075] See Figure 4 , Figure 4 A state change table for a one-bit Gray code counter is provided in this application. From... Figure 4 As can be seen, Q0 only flips on the falling edge of CLK, and its logical expression is as follows:

[0076]

[0077] Where Q0(n) is the state of the auxiliary unit at time n; Q0(n+1) is the state of the auxiliary unit at time n+1; and n is any time, such as T1, T2, etc.

[0078] Further, see Figure 4At any given moment, the combination of CLK and Q0 corresponds to either a 1 or a 0 state of Q1. Therefore, the Gray code counter of this application does not require limiting the initial state of Q1, thus making the Gray code counter more stable. Consequently, this Gray code counter supports reset to 0 and reset to 1 functions, and also supports inverse code output. Figure 4 As shown at times T2, T3, T6, and T7, before the Q1 state flips, both CLK and Q0 are 0. In other words, Q1 flips when both CLK and Q0 are 0; otherwise, it does not flip. Therefore, the logical expression for the flip of the first Gray code state in the Gray code counter provided in this application is as follows:

[0079]

[0080] Y = CLK + Q0(n) (3)

[0081] In this context, formula (2) represents the XOR logic, and formula (3) represents the OR logic. Q1(n) is the state of the first Gray code at time n; Q1(n+1) is the state of the first Gray code at time n+1. It should be noted that the primary D flip-flop in the primary counter is configured to be rising-edge triggered. Optionally, the primary D flip-flop is configured to be falling-edge triggered.

[0082] According to the embodiments of this application, the zero-level D flip-flop of the auxiliary unit and the primary D flip-flop of the primary counter receive the same clock signal. This avoids delays in updating the first Gray code state caused by asynchrony between the auxiliary unit and the primary counter.

[0083] According to the embodiments of this application, such as Figure 2 As shown, the Gray code counter has simple logic. The primary counter and auxiliary unit are cascaded in series, which greatly reduces the difficulty of expanding the Gray code counter. For example, the auxiliary unit also includes an NOT gate, which is connected in series with a zero-level D flip-flop to serve as a buffer or amplifier.

[0084] Furthermore, since the aforementioned one-bit Gray code counter has low logical complexity and is easy to expand, this application embodiment provides a continuation counter, which is cascaded with the initial counter in series to achieve the output of the higher-order Gray code (number of bits m≥2).

[0085] For example, embodiments of this application provide a two-bit Gray code counter based on the above-described one-bit Gray code counter. Figure 5 An optional state change table for a two-bit Gray code counter is provided. See also Figure 5When Q0 / Q1 = 10 (i.e., a simplified version of Q0 = 1 and Q1 = 0, and so on for higher bits), the state of Q2 flips in the next moment; otherwise, Q2 does not flip. That is, when Q0 / Q1 = 10, In other cases, Q2(n+1) = Q2(n) does not flip. Figure 5 The T5 and T13 times in the diagram show the case where CLK enters the falling edge but does not trigger the Q2 state toggle. Figure 5 The Q2 state change logic shown in the figure satisfies the following expression:

[0086]

[0087]

[0088] Formula (4) represents the XOR logic, and formula (5) represents the OR logic. Figure 6 Figures (a) and (b) show the circuit diagrams that satisfy formulas (4) and (5). Figure 6 The output of the initial counter in (a) and (b) is consistent. In actual use, expression (5) uses a NOR gate and performs... and The XOR operation can reduce the number of MOSFETs while maintaining logical consistency. This allows for a reduction in circuit complexity and integrated circuit layout area while increasing the number of Gray code bits.

[0089] Going a step further, Figure 7 It shows in Figure 5 The provided two-digit Gray counter is used to expand the state change table to a third digit. See also... Figure 7 When Q0 / Q1 / Q2 = 110, In other cases, Q3(n+1) = Q3(n). That is, when the states of Q0, Q1, and Q2 are 1, 1, and 0 respectively, the state of Q3 flips in the next moment. The state change logic of Q3 satisfies the following expression:

[0090]

[0091]

[0092] Formula (6) represents the XOR logic, and formula (7) represents the OR logic. Figure 8 The circuit module constructed according to the above formulas (6) and (7) is shown.

[0093] Following this logic, the inventors of this application unexpectedly discovered that for the m-th bit of a Gray code counter with M greater than or equal to 2 bits (where 2 ≤ m ≤ M), when Q0 / Q1 / Q2…Qm-1=111…10, In other cases, Qm(n+1) = Qm(n). Therefore, the state change logic of the m-th bit of the high-order Gray code counter provided in this application satisfies the following expression:

[0094]

[0095] Y = Y m-1 + Qm-1(n); (9)

[0096]

[0097] 2≤m≤M; (11)

[0098] Where Ym-1 represents the logical operation result of the m-th stage OR gate, which is used as the logical input of the OR gate when the m-th Gray code circuit is cascaded with the next circuit module (i.e., the m+1-bit Gray code circuit); Y represents all logical operation results, which trigger the output of this stage (m-bit Gray code); Qm(n) represents the state of the m-th stage circuit at time n; Qm(n+1) represents the state of the m-th stage circuit at time n+1.

[0099] Figure 9 The circuit module constructed according to formulas (8) to (11) is shown. See [link to relevant documentation]. Figure 9 The circuit module includes an m-th stage two-input OR gate, an m-th stage two-input NOR gate, an m-th stage XNOR gate, and an m-th stage D flip-flop connected in series from input to output; and 2 ≤ m ≤ M. The inputs and outputs of the m-th stage two-input OR gate, the m-th stage two-input NOR gate, the m-th stage two-input XNOR gate, and the m-th stage D flip-flop are as follows: Figure 9 As shown. See also Figure 9 This module triggers the Gray code loading and flipping of the m-th stage only when the output state of the (m-1)-th stage makes Y = 0. Therefore, the Gray code counter provided in this application does not require selection of the input signal, has clear logic, and a simpler and more stable circuit. It should be noted that the m-th stage D flip-flop in the succession counter is configured to be rising-edge triggered. Optionally, the m-th stage D flip-flop is configured to be falling-edge triggered. It should be understood that in the same Gray code counter, all D flip-flops in the succession counters use the same triggering mechanism, i.e., all are either rising-edge triggered or all are falling-edge triggered.

[0100] It should be noted that the high-order logic of the continuation counter provided in this application does not increase in complexity with the increase of the Gray code bit width. Therefore, it avoids the situation where the number of components required to build each stage of the high-order Gray code circuit is higher than the number required to build the previous stage. Thus, it avoids the problem that each stage of the circuit requires more components than the previous stage as the Gray code bit width increases, thereby improving the integration density of the Gray code counter.

[0101] In some optional implementations, when the number of bits M in the Gray code is greater than or equal to 2, the Gray code provided in this application further includes M-1 succession counters. These M-1 succession counters are cascaded in series with the previous stage circuit as the number of bits M in the Gray code increases. For example, the succession counter corresponding to the second Gray code bit is cascaded with the initial counter, the succession counter corresponding to the third Gray code bit is cascaded with the succession counter corresponding to the second Gray code bit, and so on. Exemplarily, each of the aforementioned M-1 succession counters includes an m-th stage two-input OR gate, an m-th stage two-input NOR gate, an m-th stage XNOR gate, and an m-th stage D flip-flop connected sequentially from input to output; and 2 ≤ m ≤ M.

[0102] It should be noted that the Gray code counter provided in the above embodiments has clear logic and a simple circuit structure, and can support inverse code operations based on the above formulas (4) to (11). Therefore, the logic gates in the above embodiments can be replaced by logic gates with the same logical function. For example, an XOR gate can be replaced by an inverted input XOR gate. Therefore, under the premise that the logical function remains unchanged, the replacement scheme of the logic gate is also within the protection scope of this application.

[0103] According to the implementation method of this application, taking a 14-bit Gray code counter as an example, if a 14-bit Gray code counter is used... Figure 6 The circuit shown in (a) serves as the initial counter. For example... Figure 10 As shown, the 14-bit Gray code counter provided in this embodiment includes an auxiliary unit, an initial counter, and a 13-stage succession counter. The auxiliary unit's logic gates include one NOT gate, totaling two Metal Oxide Semiconductor Field Effect Transistors (MOSFETs). The initial counter's logic gates include one NOT gate, one two-input NOR gate, and one XNOR gate, requiring a total of 14 MOSFETs. Starting from the second stage, each succession counter's logic gates include one OR gate, one two-input NOR gate, and one XNOR gate, requiring a total of 18 MOSFETs. Therefore, the 14-bit Gray code counter provided in this embodiment requires a total of 248 MOSFETs. In contrast, the number of MOSFETs required in each stage of a Gray code counter in related technologies increases with the stage number, meaning that the number of MOSFETs required in each stage is higher than the previous stage. For example, Figure 11 This illustrates a 14-bit Gray code counter from the related art, such as... Figure 11 As shown, this 14-bit Gray code counter includes 15 stages of circuitry, where any stage of the circuit contains 2 logic gates. An input NOR gate and a three-input NOR gate require a total of 4M+2 MOSFETs. It is easy to see that in related technologies, the number of MOSFETs required for each logic gate increases with the number of bits in that stage; a 14-bit Gray code counter requires a total of 524 MOSFETs. Therefore, the logic operation and circuitry provided in this application achieve modularity for the successive-bit counter, thereby avoiding the increase in the number of devices and the corresponding increase in chip area caused by the increase in the number of bits. Furthermore, the higher the number of bits, the more obvious the advantages of the Gray code counter provided in this application—requiring fewer devices and a smaller chip area.

[0104] According to the embodiments of this application, the m-th stage D flip-flop of the continuation counter, the primary D flip-flop of the initial counter, and the zero-stage D flip-flop of the auxiliary unit receive the same clock signal, thereby avoiding delay when updating the high-order Gray code state.

[0105] According to some optional implementations, the Gray code counter provided in this application also includes an extension module, such as... Figure 12 The extension module can be deployed in the start stage of a Gray code counter (also known as the low-order circuitry, such as the first i stages of an initial counter and / or a continuation counter, where i is a positive integer), such as... Figure 13 The expansion module shown can also be deployed at the end stage of the Gray code counter (also called the high-order circuit, such as the last j stages of the initial counter and / or the continuation counter, where j is a positive integer). When the expansion module is set at the start stage, it can control the input signal of the initial counter or the continuation counter; when the expansion module is set at the end stage, it can control the output signal of the continuation counter. Therefore, by configuring interface modules at the start and end stages of the Gray code counter, respectively, it is possible to extend the Gray code counter beyond the module's capacity. For example, cascading any two Gray code counters according to the embodiments of this application can achieve Gray code output of any number of bits. Theoretically, using two control signals to control the expansion input module and the expansion output module respectively, the Gray code counters according to the embodiments of this application can be cascaded without limitation.

[0106] For example, such as Figure 12 As shown, the expansion module is a 2:1 MUX, configured in the start stage of the Gray code counter provided in this application. Figure 12 The output of the extended module Q1 is invalid. For example, as shown below... Figure 13 As shown, the extension module is a transmission gate, which is configured at the end of the Gray code counter provided in this application.

[0107] Example 1

[0108] like Figure 14 and Figure 15As shown, Embodiment 1 provides a 10-bit Gray code counter according to this application. In Embodiment 1, the auxiliary unit, the initial counter, and the continuation counter use the same clock signal (master clock signal). Figure 14 This is a schematic diagram of an optional package for the 10-bit Gray code counter. Figure 15 The schematic diagram of this 10-bit Gray code counter shows its logic circuit. Figure 15 As can be seen, the initial counter logic of the Gray code counter provided in this application is simple, and the difficulty of digit expansion is low. Furthermore, the logic of the successive counter in this application is clear, and the logic and structure of each stage circuit are identical, greatly reducing the difficulty of digit expansion and circuit complexity. In addition, the simple structure of this Gray code counter helps to reduce the number of components and the layout area.

[0109] This application uses simulation software to... Figure 15 The circuit shown was simulated. Figure 15 The circuit is packaged as a module, the input of the counter is set to MC (master clock signal), and set-1 and set-0 control signals are added. The output bits are Q1 to Q10, a total of 10 signals. Figure 16 A simulation diagram of the positive output of the 10-bit Gray code counter provided in Example 1 is shown, with the main clock starting from a high level (1). Figure 17 The diagram shows the inverted output simulation of the 10-bit Gray code counter provided in Example 1, with the main clock starting from a low level (0). Figure 18 A simulation diagram of setting and resetting the 10-bit Gray code counter provided in Example 1 is shown. See also... Figure 18 When the set signal is inserted, the counter is set to 1, and the subsequent output is stable and glitch-free.

[0110] Example 2

[0111] like Figures 19 to 21 As shown, Embodiment 2 provides a schematic diagram of module expansion based on Embodiment 1. In Embodiment 2, two 10-bit Gray code counters according to the embodiments of this application are cascaded to achieve 19-bit Gray code output, and the two 10-bit Gray code counters are simultaneously controlled by the master clock signal. The expansion enable module EN_EXT is active high and blocked low. Furthermore, the EN_EXT of any 10-bit Gray code counter serves as a switch for a 2:1 MUX (Multiplexer) and a transmission gate. Figure 19 A schematic diagram of an optional package for the scalable 10-bit Gray code counter provided in Embodiment 2 is shown. Figure 20 A schematic diagram of an optional package for the 19-bit Gray code counter provided in Embodiment 2 is shown. Figure 21A schematic diagram of two scalable 10-bit Gray code counters connected in series in the 19-bit Gray code counter provided in Embodiment 2 is shown.

[0112] Figure 22 The simulation of the output of bits 1 to 9 in the 19-bit Gray code counter provided in Example 2 is shown. Figure 23 The simulation of the output of bits 10 to 18 of the 19-bit Gray code counter provided in Example 2 is shown. It should be noted that, in order to make the simulation results of each output level clear and unambiguous, Figure 22 and Figure 23 Different amplification factors were used, and because the simulation time required for the most significant bit voltage to flip doubles with each additional bit, therefore... Figure 23 Only up to the 18th Gray code is displayed. See also Figure 12 and Figure 12 ,Although Figure 12 and Figure 13 The output is provided by two different 10-bit Gray code counters, but under the control of the same set of clock signals, the output accuracy and stability of different bits (Q1 to Q18) are excellent, with no glitches or delays.

[0113] In summary, the Gray code counter provided in this application embodiment achieves a single-bit Gray code output through an auxiliary unit combined with an initial counter. Furthermore, the Gray code counter has clear logic, a simple structure, and is easily expandable. The Gray code counter provided in this application embodiment achieves bit expansion through a succession counter; there is no transition state between adjacent Gray codes, providing a stable and unique output. Moreover, the logic and circuitry of succession counters with different bit numbers do not change with the number of bits; bit expansion can be achieved through cascading, realizing a modular design. In addition, the succession counter uses only three logic gates, requiring fewer components and reducing the layout area. The Gray code counter provided in this application embodiment uses the same clock signal, ensuring stable output.

[0114] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.

Claims

1. A Gray code counter, characterized by The Gray code counter includes an auxiliary unit and an initial counter; The auxiliary unit includes a zero-level D flip-flop; The initial counter includes a primary NOT gate, a primary two-input NOR gate, a primary two-input XNOR gate, and a primary D flip-flop, which are electrically connected sequentially from input to output; and... Either input of the primary two-input NOR gate is electrically connected to the clock of the zero-level D flip-flop; wherein, the output logic of the Gray code counter satisfies: Q0(n+1) = ,(CLK↓) ; Q1(n+1) = Y•Q1(n) + • = Y⊙Q1(n),(CLK↑); Y = CLK + Q0(n); Where Q0(n) is the state of the auxiliary unit at time n; Q0(n+1) is the state of the auxiliary unit at time n+1; n is any time; Y is the result of all logic operations at one input of the XNOR gate; CLK is the clock signal, ↑ represents the rising edge and ↓ represents the falling edge.

2. The Gray code counter according to claim 1, characterized in that, When the number of bits M in the Gray code is greater than or equal to 2, the Gray code counter further includes M-1 continuation counters; the M-1 continuation counters are cascaded sequentially as the number of bits M in the Gray code increases. Each of the M-1 repeating counters includes an m-th stage two-input OR gate, an m-th stage two-input NOR gate, an m-th stage XOR gate, and an m-th stage D flip-flop connected sequentially from the input to the output; and 2≤m≤M.

3. The Gray code counter according to claim 2, characterized in that, When m=2, any one of the input terminals of the m-th level two-input OR gate is electrically connected to the input terminal of the primary NOT gate; When m > 2, any one of the input terminals of the m-th stage two-input OR gate is electrically connected to the output segment of the (m-1)-th stage two-input OR gate.

4. The Gray code counter according to claim 2, characterized in that, The output logic of the Gray code counter also satisfies: Y m-1 = + +…+ ; Y = Y m-1 + Qm-1(n); Qm(n+1) = Y•Qm(n) + • = ⊙ ; 2≤m≤M; Where Ym-1 represents the logical operation result of the m-th level OR gate; Y represents the logical operation result of all input terminals of the XNOR gate; Qm(n) represents the state of the m-th level circuit at time n; Qm(n+1) represents the state of the m-th level circuit at time n+1; n is any time.

5. The Gray code counter according to any one of claims 1 to 4, characterized in that, The zero-level D flip-flop is configured to be triggered on the falling edge, and the primary D flip-flop is configured to be triggered on the rising edge.

6. The Gray code counter according to claim 2 or 4, characterized in that, The m-th stage D flip-flop is configured to be triggered on the rising edge.

7. The Gray code counter according to any one of claims 1 to 4, characterized in that, The minimum period of the output of the auxiliary unit includes 2 CLK periods; Furthermore, the minimum period is half the period of the output of the initial counter.

8. The Gray code counter according to any one of claims 1 to 4, characterized in that, The zero-level D flip-flop and the primary D flip-flop receive the same clock signal.

9. The Gray code counter according to claim 2 or 4, characterized in that, The zero-level D flip-flop, the primary D flip-flop, and the m-th level D flip-flop all receive the same clock signal.

10. The Gray code counter according to claim 2, characterized in that, The initial counter further includes an expansion module; and / or, Any one or more of the M-1 repeater counters also include an expansion module.

11. The Gray code counter according to claim 10, characterized in that, The expansion module is electrically connected to the input terminal of the initial counter; or, The expansion module is electrically connected to the input terminal of the last of the M-1 succession counters.

Citation Information

Patent Citations

  • Even-number-of-times Gray code counter circuit

    CN108880531A