US20050024241A1 - Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's - Google Patents

Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's Download PDF

Info

Publication number
US20050024241A1
US20050024241A1 US10/926,114 US92611404A US2005024241A1 US 20050024241 A1 US20050024241 A1 US 20050024241A1 US 92611404 A US92611404 A US 92611404A US 2005024241 A1 US2005024241 A1 US 2005024241A1
Authority
US
United States
Prior art keywords
value
integer
gray code
binary
range
Prior art date
Legal status (The legal status 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 status listed.)
Abandoned
Application number
US10/926,114
Inventor
Ashwani Oberai
Kavitha Prasad
Sreenath Kurupati
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Intel Corp
Original Assignee
Intel Corp
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 Intel Corp filed Critical Intel Corp
Priority to US10/926,114 priority Critical patent/US20050024241A1/en
Assigned to INTEL CORPORATION reassignment INTEL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: KURUPATI, SREENATH, OBERAI, ASHWANI, PRASAD, KAVITHA A.
Publication of US20050024241A1 publication Critical patent/US20050024241A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/14Conversion to or from non-weighted codes
    • H03M7/16Conversion to or from unit-distance codes, e.g. Gray code, reflected binary code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2205/00Indexing scheme relating to group G06F5/00; Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F2205/10Indexing scheme relating to groups G06F5/10 - G06F5/14
    • G06F2205/102Avoiding metastability, i.e. preventing hazards, e.g. by using Gray code counters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • G06F5/10Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor having a sequence of storage locations each being individually accessible for both enqueue and dequeue operations, e.g. using random access memory

Definitions

  • Embodiments of the invention relate generally to an encoding process and more particularly to a method and apparatus to generate Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous First In First Out (FIFO) buffers.
  • FIFO First In First Out
  • First In First Out (FIFO) buffers are often used to store and retrieve data. This is accomplished by writing the incoming data from one clock domain in the FIFO and then retrieving the data from the other clock domain. In addition to the data transfer across the clock domain boundary, write and read pointers of the FIFO are communicated across these domains to flag FIFO full and empty conditions, as well as other conditions.
  • FIFO First In First Out
  • Metastability exists when a signal is transitioning between states at the same time it is being sampled. The sampling device expects one of either two states and is not configured to correctly interpret the transitioning signal. Metastability is always a design concern in asynchronous environments.
  • the FIFO write pointer and read pointer is encoded in Gray code before transmission to the other clock domain. This is done because of the adjacency principle between two successive Gray code values. This is true even when the pointer wraps around, i.e. while going from 7 (Gray code 100) to 0 (Gray code 000) there is only 1 bit change.
  • Gray code counting techniques have long been recognized. Gray code can be described as an encoding of numbers resulting in any two adjacent numbers only differing by one digit. Ascending or descending through a Gray code sequence of numbers results in exactly one digit change, by either adding a new digit or by changing only one existing digit. This is beneficial in computing environments because additional changes introduce opportunity for additional errors.
  • the first four values of ordinary binary representation are 00, 01, 10, 11.
  • the change from the second number, 01, to the third number, 10, results in 2 digit changes.
  • the 1's placeholder goes from 1 to 0, and the 2's placeholder goes from 0 to 1.
  • Gray code representation The first four values of Gray code representation are 00, 01, 11, and 10. As can be seen in this representation, exactly one digit change exists for each adjacent Gray code representation. This is commonly called the adjacency principle. For any counting sequence, Gray code representation therefore substantially decreases opportunity for error introduction.
  • Gray code counting technique One disadvantage to the Gray code counting technique is that it only works when counting a number of values that is a power of 2, e.g. 2 values, 4 values, 8 values, 16 values, etc. For instance, if the same code was used to count 6 values (from 0 to 5), the moment the pointer wrapped around from 5 (111) to 0 (000), there would be a 3 bit change. Therefore, the adjacency principle of Gray code is currently only utilized when the range is a power of 2. This is a common problem in all FIFO's whose depth is not a power of 2.
  • FIG. 1 is an illustration of one embodiment of a circuit for generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • FIG. 2 is an illustration of one embodiment of a circuit for conducting a bit-by-bit exclusive OR (XOR) as shown as the functional block labeled bit-by-bit XOR of the embodiment circuit in FIG. 1 .
  • XOR bit-by-bit exclusive OR
  • FIG. 3 is a flowchart illustrating one embodiment of a method for generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • FIG. 4 is an illustration of one embodiment of a computing system capable of generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • a method and apparatus for generating Gray code for any even count value and, more particularly, to a method and apparatus to generate Gray code for any even count value that, for example, may be applied to enable efficient pointer exchange mechanisms in asynchronous First In First Out (FIFO) buffers are disclosed.
  • FIFO First In First Out
  • an innovative Gray code generator is introduced to enable the adjacency principles and benefits of Gray code to extend beyond even powers of two, for example if used to pass pointers for a FIFO buffer of an even but non power of two depth.
  • Gray code counting techniques have long been recognized but have only limited application.
  • the utility of the Gray code adjacency principle can be greatly expanded utilizing embodiments of the present invention. What is needed therefore is a method and apparatus to utilize the adjacency principle of Gray code for a range of numbers that is not a power of two, in addition to the power of two numbers for which it is currently used.
  • One embodiment provides a circuit design that results in an increased application of Gray code.
  • the embodiment provides an increased range, which includes the previous integer power of two values, including as well all other even count values to result in a range of numbers that when converted to Gray code representation result in the adjacency principle applying not only between every value but also between the highest and lowest value.
  • circuitry 100 an embodiment of the present invention is disclosed in circuitry 100 .
  • the circuitry as shown is for descriptive purposes only, and that other variations for accomplishing the described aspects of the circuitry may be employed without departing from the principles of or exceeding the scope of the present invention.
  • the need for the top elements of the circuit 100 in FIG. 1 including maximum count 102 , binary count 104 , subtractor 108 , adder 110 , right shift by 1 register 112 , multiplexer (MUX) 124 , right shift by 1 register 114 and bit-by-bit XOR 116 , may be obviated by replacing them with a hard coded value equal to their output and before the circuit is created.
  • MUX multiplexer
  • the binary count 104 is a predetermined value that is dependent upon architecture needs.
  • the circuit 100 is used for generating pointer values for a FIFO buffer in an asynchronous environment, the binary count value would be set to the depth of the FIFO buffer. For instance when the FIFO buffer was 10 registers deep, the binary count value would be fixed at 1010, i.e., the binary representation of 10.
  • maximum count 104 is defined as the maximum value that can be represented by the number of digits in a binary representation of a value. If the binary count 104 value is 1010, as shown above, then the maximum count 104 value would be 1111, or decimal 15.
  • a binary count value 104 is input to a subtractor 108 .
  • the maximum count 102 is also connected to the subtractor 108 .
  • the subtractor 108 subtracts the binary count 104 value from the maximum count 102 and provides this output to an adder 110 . In the above example this would result in a value of 1111 minus 1010 resulting in 0101, which is equal to decimal 15-10, or 5.
  • the adder 110 adds the value from the subtractor to the value 1 and outputs to a right shift by 1 register 112 . To continue the example, this results in the addition of 5 and 1 to yield 6, or in binary 0110.
  • the right shift by 1 register 112 effectively divides the value from the adder by 2 and provides its output value to a multiplexer 124 . The example number in this instance would be shifted to the right one, resulting in 011, which is decimal 3.
  • the multiplexer 124 has 1 other data input that is hard coded at 0.
  • the same initial binary count value provided in block 104 also undergoes a test to determine if it is a power of 2.
  • Binary count value 104 is input to a right shift by 1 register 114 and then into a bit-by-bit XOR circuit 116 before the result is the selector value for the multiplexer.
  • the multiplexer 124 therefore will select the output of the right shift by 1 register 112 if the selector value is 0 and the multiplexer 124 will select 0 as its output if the selector value is 1.
  • the example number would result in the binary count 104 , in this case 1010, or 10, to be shifted to the right by one digit, resulting in 101 .
  • the output of the MUX 124 , the offset value, is also listed in FIG. 1 as the value “I”.
  • the portion of the example circuit 100 that generates the “I” value may also be determined in advance, and the “I” value may be hard coded.
  • the buffer depth will be known and will often be static hardware, therefore the “I” offset value can be determined in advance and be used as an input to the lower portion of the circuit 100 of the embodiment in FIG. 1 .
  • the entire circuit may be implemented in software, including ASICs, CMOS, etc., in which case the circuit may represent a flow chart of the software implementing an embodiment.
  • the “I” offset value and a binary counter's 130 values are inputs to an adder 132 .
  • the adder 132 outputs the result to a binary to Gray converter 134 .
  • the output from the binary to Gray converter is the shifted value that provides complete adjacency principle operation for any even count range of numbers.
  • the “I” offset is selected at 3, or in binary 011, when the buffer depth is 10.
  • the binary counter 130 would then output a range of 10 values, from 0 to 9, or in binary from 0000 to 1001. Each of these values is added to the “I” value, in this example binary 011, to result in a shifted binary set of numbers with a range of 10 values.
  • the shifted values may be used in additional processing, for example, in Synchronization logic 136 as pointers for FIFO buffers in an asynchronous environment.
  • FIG. 2 an embodiment 200 of the bit-by-bit XOR 116 circuit portion of the embodiment in FIG. 1 is shown.
  • a bit-by-bit XOR may be implemented by connecting the parallel bus 202 to a series of XOR gates. The XOR gates are connected in a fashion where the left most two bits from the parallel bus 202 are XORed first in Exclusive OR gate 206 . The result of this Exclusive OR operation is XORed with the third leftmost bit from the parallel bus 202 in Exclusive OR gate 210 . The result of Exclusive OR gate 210 is XORed with the fourth leftmost bit from the parallel bus 202 in Exclusive OR gate 214 .
  • bit-by-bit XOR may be implemented on any data width and need not be restricted to the 4 bit wide example of the embodiment 200 in FIG. 2 . Greater or fewer XOR gates may be added or subtracted such that they are sufficient to XOR in the fashion shown above for the entire data set provided by the parallel bus 202 . It will be understood by one of ordinary skill in the art that the bit-by-bit XOR circuit 200 shown in FIG. 2 may be implemented using different types or arrangements of gates without departing from the scope of the present invention.
  • FIG. 3 the particular methods of the invention are described in terms of computer software with reference to a flowchart 300 .
  • the methods to be performed by a computer constitute computer programs made up of computer-executable instructions.
  • the computer-executable instructions may be written in a computer programming language or may be embodied in firmware logic. If written in a programming language conforming to a recognized standard, such instructions can be executed on a variety of hardware platforms and for interface to a variety of operating systems or without an operating system.
  • FIG. 3 is a flow chart 300 illustrating one embodiment of a process for generating Gray code for non integer powers of 2 even numbers.
  • circuit 100 receives a value.
  • circuit 100 determines the number of binary digits to represent the received value.
  • the result of block 302 is compared to the maximum count 102 that may be represented by the number of binary digits of the received value, and a difference is determined.
  • circuit 100 divides the difference from block 304 by 2, thus obtaining a quotient.
  • the quotient is added to each value in a range from 0 to the received value.
  • the circuit 100 converts the result of block 308 to corresponding Gray code representation.
  • FIG. 4 is a block diagram of one embodiment 400 of a computer system.
  • one embodiment 400 may be a networking device, or other computing system that operates as a router, server or hub or any other node in a computer network exchanging signals between any other network elements.
  • the computer system illustrated in FIG. 4 is intended to represent a range of computer systems. Alternative computer systems can include more, fewer and/or different components.
  • Computer system 400 includes bus 401 or other communication device to communicate or transmit information, and processor 402 coupled to bus 401 to process information.
  • Processor 402 may include semiconducting processors generally, ASICs, PLDs, FPGAs, DSPs, embedded processors, chipsets, or any other processing device. While computer system 400 is illustrated with a single processor, computer system 400 can include multiple processors and/or co-processors.
  • Computer system 400 further includes random access memory (RAM) or other dynamic storage device 404 (referred to as main memory), coupled to bus 401 to store information and instructions to be executed by processor 402 .
  • Main memory 404 also can be used to store temporary variables or other intermediate information during execution of instructions by processor 402 .
  • Computer system 400 also includes read only memory (ROM) and/or other static storage device 406 coupled to bus 401 to store static information and instructions for processor 402 .
  • Data storage device 407 is coupled to bus 401 to store information and instructions.
  • Data storage device 407 such as a magnetic disk or optical disc and corresponding drive can be coupled to computer system 400 .
  • Computer system 400 can also be coupled via bus 401 to display device 421 , such as a cathode ray tube (CRT) or liquid crystal display (LCD), to display information to a computer user.
  • display device 421 such as a cathode ray tube (CRT) or liquid crystal display (LCD)
  • Alphanumeric input device 422 is typically coupled to bus 401 to communicate information and command selections to processor 402 .
  • cursor control 423 is Another type of user input device, such as a mouse, a trackball, or cursor direction keys to communicate direction information and command selections to processor 402 and to control cursor movement on display 421 .
  • Computer system 400 further includes network interface 430 to provide access to a network, such as a local area network.
  • Instructions are provided to memory from a storage device, such as magnetic disk, a read-only memory (ROM) integrated circuit, CD-ROM, DVD, via a remote connection (e.g., over a network via network interface 430 ) that is either wired or wireless, etc.
  • a storage device such as magnetic disk, a read-only memory (ROM) integrated circuit, CD-ROM, DVD
  • a remote connection e.g., over a network via network interface 430
  • hard-wired circuitry can be used in place of or in combination with software instructions to implement embodiments of the invention.
  • the present invention is not limited to any specific combination of hardware circuitry and software instructions.
  • the apparatus may be specially constructed for the required purposes, or may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer.
  • a computer program may be stored in a machine-readable storage medium, such as, but not limited to, any type of magnetic or other disk storage media including floppy disks, optical storage media, CD-ROMs, and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, Flash memory, magnetic or optical cards; electrical, optical, acoustical or other form of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.), or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus.
  • a storage medium 407 including executable content or instructions 408 is connected to control logic in the processor 402 to selectively access and execute the content 408 to implement generation of Gray code values for any even count range of values, an example application being used as pointers for FIFO buffers in an asynchronous environment, such that the pointers maintain the adjacency principles of Gray code between all values included when wrapping from the highest value in the range to the lowest value. It will be understood by one of ordinary skill in the art how to configure a Gray code generation circuit or program to implement the creation of this range of values that benefit from the adjacency principle.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

A method and apparatus for generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's. Allowing Gray code for any range of even count values provides the benefit of decreasing metastability when exchanging pointers for FIFO buffers in asynchronous environments. Utilizing the Gray code adjacency principle, which provides that only one bit changes for any successive numbers, in a larger class of numbers than previously utilized, decreases metastability.

Description

    TECHNICAL FIELD
  • Embodiments of the invention relate generally to an encoding process and more particularly to a method and apparatus to generate Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous First In First Out (FIFO) buffers.
  • BACKGROUND
  • In hardware devices requiring data transfer between multiple clock domains, First In First Out (FIFO) buffers are often used to store and retrieve data. This is accomplished by writing the incoming data from one clock domain in the FIFO and then retrieving the data from the other clock domain. In addition to the data transfer across the clock domain boundary, write and read pointers of the FIFO are communicated across these domains to flag FIFO full and empty conditions, as well as other conditions.
  • A common problem in sending signals across clock domain boundaries is metastability. Metastability exists when a signal is transitioning between states at the same time it is being sampled. The sampling device expects one of either two states and is not configured to correctly interpret the transitioning signal. Metastability is always a design concern in asynchronous environments.
  • To minimize metastability and other error conditions, the FIFO write pointer and read pointer is encoded in Gray code before transmission to the other clock domain. This is done because of the adjacency principle between two successive Gray code values. This is true even when the pointer wraps around, i.e. while going from 7 (Gray code 100) to 0 (Gray code 000) there is only 1 bit change.
  • The benefits of Gray code counting techniques have long been recognized. Gray code can be described as an encoding of numbers resulting in any two adjacent numbers only differing by one digit. Ascending or descending through a Gray code sequence of numbers results in exactly one digit change, by either adding a new digit or by changing only one existing digit. This is beneficial in computing environments because additional changes introduce opportunity for additional errors.
  • For example, the first four values of ordinary binary representation are 00, 01, 10, 11. The change from the second number, 01, to the third number, 10, results in 2 digit changes. The 1's placeholder goes from 1 to 0, and the 2's placeholder goes from 0 to 1. These types of changes, as stated above, provide opportunity for error introduction in electromagnetic signaling systems.
  • The first four values of Gray code representation are 00, 01, 11, and 10. As can be seen in this representation, exactly one digit change exists for each adjacent Gray code representation. This is commonly called the adjacency principle. For any counting sequence, Gray code representation therefore substantially decreases opportunity for error introduction.
  • One disadvantage to the Gray code counting technique is that it only works when counting a number of values that is a power of 2, e.g. 2 values, 4 values, 8 values, 16 values, etc. For instance, if the same code was used to count 6 values (from 0 to 5), the moment the pointer wrapped around from 5 (111) to 0 (000), there would be a 3 bit change. Therefore, the adjacency principle of Gray code is currently only utilized when the range is a power of 2. This is a common problem in all FIFO's whose depth is not a power of 2.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • Embodiments of the invention are illustrated by way of example, and not necessarily by way of limitation in the figures of the accompanying drawings in which like reference numerals refer to similar elements.
  • FIG. 1 is an illustration of one embodiment of a circuit for generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • FIG. 2 is an illustration of one embodiment of a circuit for conducting a bit-by-bit exclusive OR (XOR) as shown as the functional block labeled bit-by-bit XOR of the embodiment circuit in FIG. 1.
  • FIG. 3 is a flowchart illustrating one embodiment of a method for generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • FIG. 4 is an illustration of one embodiment of a computing system capable of generating Gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's.
  • DETAILED DESCRIPTION
  • A method and apparatus for generating Gray code for any even count value and, more particularly, to a method and apparatus to generate Gray code for any even count value that, for example, may be applied to enable efficient pointer exchange mechanisms in asynchronous First In First Out (FIFO) buffers are disclosed. In this regard, an innovative Gray code generator is introduced to enable the adjacency principles and benefits of Gray code to extend beyond even powers of two, for example if used to pass pointers for a FIFO buffer of an even but non power of two depth.
  • In the following description numerous specific details are set forth in order to provide a thorough understanding of embodiments of the invention. It will be apparent, however, to one having ordinary skill in the art that the specific detail need not be employed to practice embodiments of the invention. In other instances, well known materials or methods have not been described in detail in order to avoid obscuring the present invention.
  • Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification do not necessarily all refer to the same embodiment.
  • As was shown above, the benefits of Gray code counting techniques have long been recognized but have only limited application. The utility of the Gray code adjacency principle can be greatly expanded utilizing embodiments of the present invention. What is needed therefore is a method and apparatus to utilize the adjacency principle of Gray code for a range of numbers that is not a power of two, in addition to the power of two numbers for which it is currently used.
  • One embodiment provides a circuit design that results in an increased application of Gray code. The embodiment provides an increased range, which includes the previous integer power of two values, including as well all other even count values to result in a range of numbers that when converted to Gray code representation result in the adjacency principle applying not only between every value but also between the highest and lowest value.
  • In FIG. 1, an embodiment of the present invention is disclosed in circuitry 100. It will be understood by one of ordinary skill in the art that the circuitry as shown is for descriptive purposes only, and that other variations for accomplishing the described aspects of the circuitry may be employed without departing from the principles of or exceeding the scope of the present invention. Specifically, the need for the top elements of the circuit 100 in FIG. 1, including maximum count 102, binary count 104, subtractor 108, adder 110, right shift by 1 register 112, multiplexer (MUX) 124, right shift by 1 register 114 and bit-by-bit XOR 116, may be obviated by replacing them with a hard coded value equal to their output and before the circuit is created.
  • The binary count 104 is a predetermined value that is dependent upon architecture needs. For example, the circuit 100 is used for generating pointer values for a FIFO buffer in an asynchronous environment, the binary count value would be set to the depth of the FIFO buffer. For instance when the FIFO buffer was 10 registers deep, the binary count value would be fixed at 1010, i.e., the binary representation of 10. In the present usage, maximum count 104 is defined as the maximum value that can be represented by the number of digits in a binary representation of a value. If the binary count 104 value is 1010, as shown above, then the maximum count 104 value would be 1111, or decimal 15.
  • In this embodiment, a binary count value 104 is input to a subtractor 108. The maximum count 102 is also connected to the subtractor 108. The subtractor 108 subtracts the binary count 104 value from the maximum count 102 and provides this output to an adder 110. In the above example this would result in a value of 1111 minus 1010 resulting in 0101, which is equal to decimal 15-10, or 5.
  • The adder 110 adds the value from the subtractor to the value 1 and outputs to a right shift by 1 register 112. To continue the example, this results in the addition of 5 and 1 to yield 6, or in binary 0110. The right shift by 1 register 112 effectively divides the value from the adder by 2 and provides its output value to a multiplexer 124. The example number in this instance would be shifted to the right one, resulting in 011, which is decimal 3. The multiplexer 124 has 1 other data input that is hard coded at 0.
  • The same initial binary count value provided in block 104 also undergoes a test to determine if it is a power of 2. Binary count value 104 is input to a right shift by 1 register 114 and then into a bit-by-bit XOR circuit 116 before the result is the selector value for the multiplexer. The multiplexer 124 therefore will select the output of the right shift by 1 register 112 if the selector value is 0 and the multiplexer 124 will select 0 as its output if the selector value is 1. The example number would result in the binary count 104, in this case 1010, or 10, to be shifted to the right by one digit, resulting in 101. Running 101 though the bit-by-bit XOR circuit 116 results in 0 as the selecting value for the MUX 124. In this case, the selector output by the bit-by-bit XOR 116 would cause the MUX 124 to select the value 011 from the right shift by 1 register 112 instead of the set 0 value on its other input line.
  • These two elements, right shift by 1 register 114 and bit-by-bit XOR register 116, of the embodiment in FIG. 1 are a way to provide a circuit to account for integer powers of two values that do not require an offset value before conversion to Gray code in order to maintain complete adjacency principle operation.
  • The output of the MUX 124, the offset value, is also listed in FIG. 1 as the value “I”. The portion of the example circuit 100 that generates the “I” value may also be determined in advance, and the “I” value may be hard coded. For example, in embodiments such as FIFO buffers in asynchronous environments, the buffer depth will be known and will often be static hardware, therefore the “I” offset value can be determined in advance and be used as an input to the lower portion of the circuit 100 of the embodiment in FIG. 1. Furthermore, the entire circuit may be implemented in software, including ASICs, CMOS, etc., in which case the circuit may represent a flow chart of the software implementing an embodiment. It will be understood by one of ordinary skill in the art that other means for providing the offset value may be used without exceeding or departing from the scope of the present invention, such as equivalent circuits or as a hard coded value or even as a value that was calculated at least in part using software.
  • In FIG. 1, on the lower portion of the embodiment circuit 100, the “I” offset value and a binary counter's 130 values are inputs to an adder 132. The adder 132 outputs the result to a binary to Gray converter 134. The output from the binary to Gray converter is the shifted value that provides complete adjacency principle operation for any even count range of numbers. To continue the above example, the “I” offset is selected at 3, or in binary 011, when the buffer depth is 10. The binary counter 130 would then output a range of 10 values, from 0 to 9, or in binary from 0000 to 1001. Each of these values is added to the “I” value, in this example binary 011, to result in a shifted binary set of numbers with a range of 10 values. The shifted values may be used in additional processing, for example, in Synchronization logic 136 as pointers for FIFO buffers in an asynchronous environment.
  • In FIG. 2, an embodiment 200 of the bit-by-bit XOR 116 circuit portion of the embodiment in FIG. 1 is shown. A bit-by-bit XOR may be implemented by connecting the parallel bus 202 to a series of XOR gates. The XOR gates are connected in a fashion where the left most two bits from the parallel bus 202 are XORed first in Exclusive OR gate 206. The result of this Exclusive OR operation is XORed with the third leftmost bit from the parallel bus 202 in Exclusive OR gate 210. The result of Exclusive OR gate 210 is XORed with the fourth leftmost bit from the parallel bus 202 in Exclusive OR gate 214.
  • The bit-by-bit XOR may be implemented on any data width and need not be restricted to the 4 bit wide example of the embodiment 200 in FIG. 2. Greater or fewer XOR gates may be added or subtracted such that they are sufficient to XOR in the fashion shown above for the entire data set provided by the parallel bus 202. It will be understood by one of ordinary skill in the art that the bit-by-bit XOR circuit 200 shown in FIG. 2 may be implemented using different types or arrangements of gates without departing from the scope of the present invention.
  • It will be understood by one of ordinary skill in the art would be to create other flowcharts illustrating how to implement other embodiments of the present invention that enable use of the adjacency principle of Gray code over any even count range of values. Turning now to FIG. 3, the particular methods of the invention are described in terms of computer software with reference to a flowchart 300. The methods to be performed by a computer constitute computer programs made up of computer-executable instructions.
  • Describing the methods by reference to a flow diagram enables one skilled in the art to develop such programs including such instructions to carry out the methods on suitably configured computers (i.e., the processor or processors of the computer executing the instructions from computer-accessible media). The computer-executable instructions may be written in a computer programming language or may be embodied in firmware logic. If written in a programming language conforming to a recognized standard, such instructions can be executed on a variety of hardware platforms and for interface to a variety of operating systems or without an operating system.
  • FIG. 3 is a flow chart 300 illustrating one embodiment of a process for generating Gray code for non integer powers of 2 even numbers. At block 300 circuit 100 receives a value. At block 302 circuit 100 determines the number of binary digits to represent the received value. At block 304 the result of block 302 is compared to the maximum count 102 that may be represented by the number of binary digits of the received value, and a difference is determined. In block 306 circuit 100 divides the difference from block 304 by 2, thus obtaining a quotient. In block 308, the quotient is added to each value in a range from 0 to the received value. In block 310, the circuit 100 converts the result of block 308 to corresponding Gray code representation.
  • FIG. 4 is a block diagram of one embodiment 400 of a computer system. Referring to FIG. 4, one embodiment 400 may be a networking device, or other computing system that operates as a router, server or hub or any other node in a computer network exchanging signals between any other network elements. The computer system illustrated in FIG. 4 is intended to represent a range of computer systems. Alternative computer systems can include more, fewer and/or different components.
  • Computer system 400 includes bus 401 or other communication device to communicate or transmit information, and processor 402 coupled to bus 401 to process information. Processor 402 may include semiconducting processors generally, ASICs, PLDs, FPGAs, DSPs, embedded processors, chipsets, or any other processing device. While computer system 400 is illustrated with a single processor, computer system 400 can include multiple processors and/or co-processors. Computer system 400 further includes random access memory (RAM) or other dynamic storage device 404 (referred to as main memory), coupled to bus 401 to store information and instructions to be executed by processor 402. Main memory 404 also can be used to store temporary variables or other intermediate information during execution of instructions by processor 402.
  • Computer system 400 also includes read only memory (ROM) and/or other static storage device 406 coupled to bus 401 to store static information and instructions for processor 402. Data storage device 407 is coupled to bus 401 to store information and instructions. Data storage device 407 such as a magnetic disk or optical disc and corresponding drive can be coupled to computer system 400.
  • Computer system 400 can also be coupled via bus 401 to display device 421, such as a cathode ray tube (CRT) or liquid crystal display (LCD), to display information to a computer user. Alphanumeric input device 422, including alphanumeric and other keys, is typically coupled to bus 401 to communicate information and command selections to processor 402. Another type of user input device is cursor control 423, such as a mouse, a trackball, or cursor direction keys to communicate direction information and command selections to processor 402 and to control cursor movement on display 421. Computer system 400 further includes network interface 430 to provide access to a network, such as a local area network.
  • Instructions are provided to memory from a storage device, such as magnetic disk, a read-only memory (ROM) integrated circuit, CD-ROM, DVD, via a remote connection (e.g., over a network via network interface 430) that is either wired or wireless, etc. In alternative embodiments, hard-wired circuitry can be used in place of or in combination with software instructions to implement embodiments of the invention. Thus, the present invention is not limited to any specific combination of hardware circuitry and software instructions.
  • The apparatus may be specially constructed for the required purposes, or may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer. Such a computer program may be stored in a machine-readable storage medium, such as, but not limited to, any type of magnetic or other disk storage media including floppy disks, optical storage media, CD-ROMs, and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, Flash memory, magnetic or optical cards; electrical, optical, acoustical or other form of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.), or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus.
  • In one embodiment a storage medium 407 including executable content or instructions 408 is connected to control logic in the processor 402 to selectively access and execute the content 408 to implement generation of Gray code values for any even count range of values, an example application being used as pointers for FIFO buffers in an asynchronous environment, such that the pointers maintain the adjacency principles of Gray code between all values included when wrapping from the highest value in the range to the lowest value. It will be understood by one of ordinary skill in the art how to configure a Gray code generation circuit or program to implement the creation of this range of values that benefit from the adjacency principle.
  • The foregoing detailed description and accompanying drawings are only illustrative and not restrictive. They have been provided primarily for a clear and comprehensive understanding of the present invention and no unnecessary limitations are to be understood therefrom. Numerous additions, deletions, and modifications to the embodiments described herein, as well as alternative arrangements, may be devised by those skilled in the art without departing from the spirit of the present invention and the scope of the appended claims.

Claims (16)

1-20. (canceled)
21. A computing appliance comprising:
a storage medium including executable content;
a control logic, coupled with the storage medium to selectively access and execute the content to generate Gray code for any even range of values.
22. A computing system according to claim 21, further comprising an input port, to receive pointers for a FIFO buffer from a network device in one clock domain.
23. A computing appliance according to claim 22 further comprising an output port, coupled to a network device in a different clock domain, to send the pointers to the network device.
24. A method of obtaining Gray code representations of values comprising:
obtaining an even range of values corresponding to a received value;
calculating an offset in accordance with the received value;
applying the offset to each value in the range; and
converting the offset values to their Gray code representations.
25. The method of claim 24, wherein obtaining the even range of values corresponding to a received value further comprises:
determining a number of binary digits that represent the received value wherein a maximum value of the range is a largest value that can be represented by the number of binary digits and a minimum value of the range is a smallest value that can be represented by the number of binary digits.
26. The method of claim 25, wherein calculating an offset in accordance with the received value further comprises:
determining a difference between the maximum value and the received value;
halving the difference and calculating a remainder, wherein the remainder is the offset.
27. The method of claim 24, wherein applying the offset to each value in the range further comprises:
adding the offset to each value in the range.
28. The method of claim 25, wherein the smallest value is zero.
29. A method comprising:
receiving any integer of a range of integers, the range having a minimum integer and a maximum integer, the total numeric count of integers from the minimum integer to the maximum integer being an even, non-power-of-two number; and
representing the integer in Gray code representation.
30. A method according to claim 29, wherein representing the integer in Gray code further comprises:
determining a number of binary digits required to represent the received integer;
subtracting the received integer from a maximum value represented when all the binary digits are one to result in a difference;
dividing the difference by two to result in a quotient;
adding the quotient to each numeric count from the minimum integer to the received integer to result in a series of sums; and
converting each sum to a corresponding Gray code representation.
31. A method according to claim 29, wherein converting each sum to Gray code representation comprises performing a conversion with a binary-to-Gray converter circuit.
32. A counter circuit to produce a count according to the adjacency principle of Gray code, comprising:
a binary counter to provide a binary integer, the binary integer selected from a range of numbers represented by a minimum number to a maximum number, the range being any even value; and
logic coupled with the binary counter to receive the binary integer and generate a representation of the binary integer according to the adjacency principle.
33. A counter circuit according to claim 32, wherein the logic further comprises arithmetic logic to perform addition and division.
34. A counter circuit according to claim 33, wherein the logic further comprises a exclusive OR (XOR) coupled with the arithmetic logic to bitwise XOR selective outputs of the arithmetic logic.
35. A counter circuit according to claim 32, wherein the logic further comprises a binary-to-Gray conversion circuit.
US10/926,114 2002-06-28 2004-08-24 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's Abandoned US20050024241A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US10/926,114 US20050024241A1 (en) 2002-06-28 2004-08-24 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US10/186,564 US6801143B2 (en) 2002-06-28 2002-06-28 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO'S
US10/926,114 US20050024241A1 (en) 2002-06-28 2004-08-24 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US10/186,564 Continuation US6801143B2 (en) 2002-06-28 2002-06-28 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO'S

Publications (1)

Publication Number Publication Date
US20050024241A1 true US20050024241A1 (en) 2005-02-03

Family

ID=29779915

Family Applications (2)

Application Number Title Priority Date Filing Date
US10/186,564 Expired - Lifetime US6801143B2 (en) 2002-06-28 2002-06-28 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO'S
US10/926,114 Abandoned US20050024241A1 (en) 2002-06-28 2004-08-24 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO's

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US10/186,564 Expired - Lifetime US6801143B2 (en) 2002-06-28 2002-06-28 Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO'S

Country Status (1)

Country Link
US (2) US6801143B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7796062B1 (en) * 2007-10-17 2010-09-14 Tellabs San Jose, Inc. Method and apparatus for providing non-power-of-two even count gray code

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6762701B2 (en) * 2002-12-16 2004-07-13 Broadcom Scalable gray code counter and applications thereof
US6937172B1 (en) * 2004-05-04 2005-08-30 Xilinx, Inc. Method and system for gray-coding counting
US7148825B2 (en) * 2004-05-10 2006-12-12 Broadcom Corporation Data interface including gray coding
US8854389B2 (en) * 2004-09-22 2014-10-07 Intel Corporation Apparatus and method for hardware-based video/image post-processing
US7359276B1 (en) 2005-09-27 2008-04-15 Xilinx, Inc. Multi-port system for communication between processing elements
US7545848B2 (en) * 2005-11-09 2009-06-09 Agilent Technologies, Inc. High resolution time stamps for periodic samples
US7518535B1 (en) 2007-12-12 2009-04-14 International Business Machines Corporation Generating a Gray code sequence for any even length using an intermediate binary sequence
JP2010160653A (en) * 2009-01-07 2010-07-22 Renesas Electronics Corp Ring buffer circuit and control circuit for the same
DE102010013683B4 (en) * 2010-04-01 2012-10-31 Siemens Aktiengesellschaft EMI reduction with special coding of counter signals
CN102843357B (en) * 2012-07-30 2016-11-16 北京网蜜在线网络有限公司 Method, application server and system for accessing network
US8966416B2 (en) 2013-03-07 2015-02-24 Cadence Design Systems, Inc. Finite-state machine encoding during design synthesis
US9622594B2 (en) * 2015-03-26 2017-04-18 Display Technologies, Llc Product display unit with movable tail
US10549374B2 (en) 2015-12-31 2020-02-04 Illinois Tool Works Inc. Welding power supply with half bridge
US10592442B2 (en) * 2017-12-11 2020-03-17 Advanced Micro Devices, Inc. Asynchronous buffer with pointer offsets
US11687246B2 (en) 2020-09-29 2023-06-27 Western Digital Technologies, Inc. Elastic buffer based asymmetric pipeline FIFO process
US11342922B1 (en) 2020-12-21 2022-05-24 Advanced Micro Devices, Inc. Direct bi-directional gray code counter

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6314154B1 (en) * 1999-11-04 2001-11-06 Vlsi Technology, Inc Non-power-of-two Gray-code counter and binary incrementer therefor
US6337893B1 (en) * 1999-11-04 2002-01-08 Philips Electronics North America Corp. Non-power-of-two grey-code counter system having binary incrementer with counts distributed with bilateral symmetry

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4119961A (en) * 1977-12-23 1978-10-10 Rca Corporation CCD Binary-to-Gray code generator
US4618849A (en) * 1984-10-31 1986-10-21 Rca Corporation Gray code counter
DE3889450T2 (en) * 1987-03-02 1994-09-29 Commw Scient Ind Res Org LIQUID JET WITH FLOW DIVERSION FOR LIQUID JET PRINTER.
US5084841A (en) * 1989-08-14 1992-01-28 Texas Instruments Incorporated Programmable status flag generator FIFO using gray code
US5450363A (en) * 1994-06-02 1995-09-12 Intel Corporation Gray coding for a multilevel cell memory system
US5754614A (en) * 1997-04-03 1998-05-19 Vlsi Technology, Inc. Gray code counter

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6314154B1 (en) * 1999-11-04 2001-11-06 Vlsi Technology, Inc Non-power-of-two Gray-code counter and binary incrementer therefor
US6337893B1 (en) * 1999-11-04 2002-01-08 Philips Electronics North America Corp. Non-power-of-two grey-code counter system having binary incrementer with counts distributed with bilateral symmetry

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7796062B1 (en) * 2007-10-17 2010-09-14 Tellabs San Jose, Inc. Method and apparatus for providing non-power-of-two even count gray code

Also Published As

Publication number Publication date
US20040001014A1 (en) 2004-01-01
US6801143B2 (en) 2004-10-05

Similar Documents

Publication Publication Date Title
US6801143B2 (en) Method and apparatus for generating gray code for any even count value to enable efficient pointer exchange mechanisms in asynchronous FIFO'S
EP1410509B1 (en) Non-power-of-two gray-code counter system having binary incrementer with counts distributed with bilateral symmetry
KR101173942B1 (en) Data transmission device, data receiving device, data transmitting system and method for transmitting data
US8612651B2 (en) FIFO buffer
CN112214349B (en) Data cyclic redundancy check device and method
US4463342A (en) Method and means for carry-over control in the high order to low order pairwise combining of digits of a decodable set of relatively shifted finite number strings
JP2003513582A (en) Gray code counter with binary incrementer and method of operating the same
US7069481B2 (en) Data recovery circuit for minimizing power consumption by non-integer times oversampling
US6370667B1 (en) CRC operating calculating method and CRC operational calculation circuit
US6442729B1 (en) Convolution code generator and digital signal processor which includes the same
JPH0775343B2 (en) Synchronization detection circuit and method
US5563594A (en) Circuit and method of timing data transfers
JPH0480815A (en) Absolute value computing circuit
Ramprasad et al. Signal coding for low power: Fundamental limits and practical realizations
US7194500B2 (en) Scalable gray code counter
US5355113A (en) Serialized difference flag circuit
CN209765494U (en) Asynchronous FIFO device
US5588010A (en) Parallel architecture error correction and conversion system
Hao et al. The principle and applications of asynchronous FIFO
US10635394B2 (en) Binary-to-gray conversion circuit, related FIFO memory, integrated circuit and method
US8122334B2 (en) Parity error detecting circuit and method
CA2021744C (en) Fast maximum likelihood decoder
US6647530B1 (en) Apparatus and method for viterbi decoding
JP3507646B2 (en) Signal transmission / reception circuit device
CN111597770A (en) Circuit device and method for quickly searching most significant bit of data

Legal Events

Date Code Title Description
AS Assignment

Owner name: INTEL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:OBERAI, ASHWANI;PRASAD, KAVITHA A.;KURUPATI, SREENATH;REEL/FRAME:015741/0077

Effective date: 20021002

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION