# US 2004/0019769 A1 · Finding a significant bit in a computer data word

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

- Number: US 2004/0019769 A1
- Document ID: US20040019769A1
- Status: Published application
- Kind: A1
- Application number: 10/202,960
- Filed: 2002-07-25
- Published: 2004-01-29
- Earliest claimed: 2002-07-25
- Assignees: Intel Corporation
- Inventors: Stephen F. Moore
- Web page: https://patentgrep.com/patent/US20040019769A1

## CPC

- G06F 9/30018: {Bit or string instructions}
- G06F 7/74: Selecting or encoding within a word the position of one or more bits having a specified value, e.g. most or least significant one or zero detection, priority encoders {(with shifting G06F5/01)}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- G06F 9/30038: {using a mask}
- G06F 9/30094: {Condition code generation, e.g. Carry, Zero flag}
- G06F 9/30101: {Special purpose registers}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The most or least significant bit of a datum can bet determined using parallel operations. This may result in faster location of the most or least significant bit without necessarily introducing more overhead in some embodiments.

## Claims

### Claim 1

A method comprising:
defining a plurality of masks;
receiving a datum and defining a shifted value of the datum;
applying each mask in parallel to the original datum value; and
comparing the result to the shifted value.

### Claim 2 (depends on 1)

The method of claim 1 wherein defining a plurality of masks includes defining a plurality of masks including a first mask having alternate bits set to one and a second mask having every other pair of bits set to one.

### Claim 3 (depends on 2)

The method of claim 2 wherein defining a plurality of masks includes defining a third mask having every other group of four bits set to one and a fourth mask having other set of eight bits set to one.

### Claim 4 (depends on 3)

The method of claim 3 including defining masks until the last mask has groups of bits that are greater than or equal to the number of bits in the datum under test.

### Claim 5 (depends on 1)

The method of claim 1 wherein defining a shifted value includes shifting the datum by one.

### Claim 6 (depends on 5)

The method of claim 5 wherein defining a shifted value includes shifting the original datum to the right by one.

### Claim 7 (depends on 1)

The method of claim 1 wherein, if the result is greater than the shifted value, setting a register to one.

### Claim 8 (depends on 7)

The method of claim 7 wherein, if the result is less than the shifted value, setting a register to zero.

### Claim 9 (depends on 1)

The method of claim 1 including loading the result of said comparison into predicate registers.

### Claim 10 (depends on 9)

The method of claim 9 including moving the results in said predicate registers to a single register.

### Claim 11

An article comprising a medium storing instructions that, if executed, enable a processor-based system to perform the steps of:
defining a plurality of masks;
receiving a datum and defining a shifted value of the datum;
applying each mask in parallel to the original datum value; and
comparing the result to the shifted value.

### Claim 12 (depends on 11)

The article of claim 11 further storing instructions that, if executed, enable the system to perform the step of defining a plurality of masks including a first mask having alternate bits set to one and a second mask having every other pair of bits set to one.

### Claim 13 (depends on 12)

The article of claim 12 further storing instructions that, if executed, enable the system to perform the step of defining a third mask having every other group of four bits set to one and a fourth mask having other set of eight bits set to one.

### Claim 14 (depends on 11)

The article of claim 11 further storing instructions that, if executed, enable the system to perform the step of defining a shifted value that includes shifting the datum by one.

### Claim 15 (depends on 14)

The article of claim 14 further storing instructions that, if executed, enable the system to perform the step of defining a shifted value that includes shifting the original datum to the right by one.

### Claim 16 (depends on 11)

The article of claim 11 further storing instructions that, if executed, enable the system to perform the step of, if the result is greater than the shifted value, setting a register to one.

### Claim 17 (depends on 16)

The article of claim 16 further storing instructions that, if executed, enable the system to perform the step of, if the result is less than the shifted value, setting a register to zero.

### Claim 18 (depends on 11)

The article of claim 11 further storing instructions that, if executed, enable the system to perform the step of loading the result of said comparison into predicate registers.

### Claim 19 (depends on 18)

The article of claim 18 further storing instructions that, if executed, enable the system to perform the step of moving the results in said predicate registers to a single register.

### Claim 20

A system comprising:
a processor; and
a storage coupled to said processor, said storage storing instructions that, if executed, enable the processor to perform the steps of:
defining a plurality of masks;
receiving a datum and defining a shifted value of the datum;
applying each mask in parallel to the original datum value; and
comparing the result to the shifted value.

### Claim 21 (depends on 20)

The system of claim 20 wherein said system includes a plurality of predicate registers, the result of said comparison being placed in said predicate registers.
