# US 6,937,172 B1 · Method and system for gray-coding counting

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 6,937,172 B1
- Document ID: US6937172B1
- Status: Granted
- Kind: B1
- Application number: 10/838,965
- Filed: 2004-05-04
- Granted: 2005-08-30
- Earliest claimed: 2004-05-04
- Assignees: Xilinx, Inc.
- Inventors: Wayson J. Lowe; Eunice Y. D. Hao; Tony K. Ngai; Peter H. Alfke
- Web page: https://patentgrep.com/patent/US6937172B1

## CPC

- G06F 5/14: for overflow or underflow handling, e.g. full or empty flags
- H03K 23/005: {using minimum change code, e.g. Gray Code}
- G06F 2205/102: Avoiding metastability, i.e. preventing hazards, e.g. by using Gray code counters
- G06F 2205/126: Monitoring of intermediate fill level, i.e. with additional means for monitoring the fill level, e.g. half full flag, almost empty flag
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03K: PULSE TECHNIQUE (measuring pulse characteristics G01R; modulating sinusoidal oscillations with pulses H03C; transmission of digital information H04L; discriminator circuits detecting phase difference between two signals by counting or integrating cycles of oscillation H03D3/04; automatic control, starting, synchronisation or stabilisation of generators of electronic oscillations or pulses where the type of generator is irrelevant or unspecified H03L; coding, decoding or code conversion, in general H03M)

## Abstract

A system for gray-code counting in an integrated circuit such as a programmable logic device uses a binary adder coupled to a binary counter output and to a selected binary offset value. The binary adder provides a binary sum that is converted to a gray code value by a binary-to-gray converter. The gray code value represents the binary sum output.

## Claims

### Claim 1

A system for gray-code counting comprising:
a binary counter coupled to a reset signal, a clock signal, and a pointer increment signal, and providing a binary output;
an adder coupled to the binary output and to a selected binary offset value, the adder providing a binary sum output; and
a binary-to-gray converter coupled to the binary sum output and providing a first gray code value representing the binary sum output.

### Claim 2 (depends on 1)

The system of claim 1 further comprising:
a multiplexer having
a first input port,
a second input port coupled to the first gray code value,
a select port coupled to a select signal, and
an output port; and
a register coupled to the output port of the multiplexer, a register output being coupled to the first input port of the multiplexer to feed back a register value if the select signal is not asserted, and to couple the first gray code value to the output register if the select signal is asserted.

### Claim 3 (depends on 2)

The system of claim 2 further comprising:
an OR gate coupled to the reset signal and to the pointer increment signal and providing the select signal to the select port of the multiplexer if either the reset signal or the pointer increment signal is asserted.

### Claim 4 (depends on 1)

The system of claim 1 wherein the binary-to-gray code converter is a 12-bit converter.

### Claim 5 (depends on 1)

The system of claim 1 wherein the binary-to-gray code converter provides a first binary input and a shifted first binary input to an exclusive NOR gate.

### Claim 6

A method for gray-code counting in a programmable logic device comprising steps of:
adding a selected pointer offset binary value to a pointer count binary value to produce a binary sum;
converting the binary sum to a gray-code value representing the binary sum;
providing the gray-code value to a first port of a multiplexer;
coupling a multiplexer output to a resister input;
coupling a register output to a second port of the multiplexer; and
incrementing the pointer count binary value in response to a pointer increment signal to create an incremented gray-code value, wherein the incremented gray-code value is selected to be coupled through the multiplexer when a multiplexer select signal is asserted.

### Claim 7 (depends on 6)

The method of claim 6 further comprising:
selecting the second port of the multiplexer to be coupled to the register when the a select signal is not asserted.

### Claim 8 (depends on 6)

The method of claim 6 further comprising:
coupling a multiplexer output to a register input;
coupling a register output to a second port of the multiplexer; and
selecting the second port of the multiplexer to be coupled to the register when the a select signal is not asserted.

### Claim 9

A system for gray-code counting in an integrated circuit comprising:
means for counting a pointer position;
means for adding an offset value to the pointer position to produce a binary sum; and
means for converting the binary sum to a gray code value;
means for multiplexing one of the gray code value and an output of a register to an input of the register.

### Claim 10 (depends on 9)

The system of claim 9 further comprising:
means for providing a select signal to the means for multiplexing, the select signal being asserted according to a reset signal or to a pointer increment signal.

### Claim 11

A programmable logic device having a system for gray-code counting comprising:
a binary counter coupled to a reset signal, a clock signal, and a pointer increment signal, and providing a binary output;
an adder coupled to the binary output and to a selected binary offset value, the adder providing a binary sum output; and
a binary-to-gray converter coupled to the binary sum output and providing a first gray code value representing the binary sum output.

### Claim 12 (depends on 11)

The programmable logic device of claim 11 further comprising:
a multiplexer in the programmable logic device, the multiplexer having
a first input port,
a second input port coupled to the first gray code value,
a select port coupled to a select signal, and
an output port; and
a register coupled to the output port of the multiplexer, a register output being coupled to the first input port of the multiplexer to feed back a register value if the select signal is not asserted, and to couple the first gray code value to the output register if the select signal is asserted.
