# US 2023/0065733 A1 · Calculator and calculation method

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

- Number: US 2023/0065733 A1
- Document ID: US20230065733A1
- Status: Published application
- Kind: A1
- Application number: 17/751,880
- Filed: 2022-05-24
- Published: 2023-03-02
- Earliest claimed: 2021-08-24
- Assignees: Fujitsu Limited
- Applicants: Fujitsu Limited
- Inventors: Hiroshi Nakao
- Web page: https://patentgrep.com/patent/US20230065733A1

## CPC

- G06F 7/78: for changing the order of data flow, e.g. matrix transposition or LIFO buffers; Overflow or underflow handling therefor
- G06F 7/02: Comparing digital values (G06F7/06, {G06F7/22,} G06F7/38 take precedence)
- G06F 9/3001: {Arithmetic instructions}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- G06F 9/30029: {Logical and Boolean instructions, e.g. XOR, NOT}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/30109: {having multiple operands in a single register}
- G06F 9/3887: {controlled by a single instruction for multiple data lanes [SIMD]}
- G06F 9/38873: {Iterative single instructions for multiple data lanes [SIMD]}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A calculator includes: registers each including sub-registers that hold pieces of data for use in operation; an operator that executes, in parallel, operations of the pieces of data; and a memory configured to hold a first vector and second vectors to be compared with the first vector. Each second vector is divided into sub-vectors and sub-vector groups each including the sub-vectors of the second vectors are arranged in units of sub-vector groups. A first process of transferring one of sub-vectors of the first vector to sub-registers of a first register among the registers, a second process of transferring the sub-vector group of the second vectors corresponding to the transferred sub-vector of the first vector to sub-registers of a second register, the sub-vector group being held in the memory, and a third process of calculating and integrating numbers of mismatches between bit values of the sub-vectors held are repeatedly executed.

## Claims

### Claim 1

A calculator comprising:
a plurality of registers each including a plurality of sub-registers that hold a plurality of pieces of data for use in operation, respectively;
an operator that executes, in parallel, operations of the pieces of data held in the plurality of sub-registers, respectively; and
a memory that is configured to hold a first vector and a plurality of second vectors to be compared with the first vector,
wherein, each of the plurality of second vectors is divided into sub-vectors each having a size equal to a size of each of the sub-registers, and a plurality of sub-vector groups each including the sub-vectors of the plurality of second vectors are sequentially arranged in a readable manner in the memory in units of sub-vector groups,
a first process of transferring one of sub-vectors of the first vector held in the memory to a plurality of sub-registers of a first register among the plurality of registers, a second process of transferring the sub-vector group of the plurality of second vectors corresponding to the transferred sub-vector of the first vector to a plurality of sub-registers of a second register among the plurality of registers, the sub-vector group being held in the memory, and a third process of calculating and integrating numbers of mismatches between bit values of the sub-vectors held in the sub-registers corresponding to each other in the first register and the second register are repeatedly executed for all sub-vectors of the first vector, and
a second vector in which an integrated value of the calculated numbers of mismatches is smallest is determined to be a closest matching vector.

### Claim 2 (depends on 1)

The calculator according to claim 1,
wherein, the numbers of mismatches between the bit values for the respective sub-vectors are stored in corresponding sub-registers of a third register in the third process, and the numbers of mismatches stored in the sub-registers of the third register are integrated in sub-registers of a fourth register, respectively, and
a second vector corresponding to the sub-register of the fourth register that holds a smallest value is determined to be the closest matching vector.

### Claim 3 (depends on 2)

The calculator according to claim 2,
wherein, the integrated values of the numbers of mismatches held in the sub-registers of the fourth register are copied in sub-registers of a fifth register,
a process of rotating the values of the sub-registers of the fifth register, storing the rotated values in sub-registers of a sixth register, respectively, and storing small values among the values of the corresponding sub-registers in the fifth register and the sixth register in the sub-registers of the fifth register is repeatedly executed until a same value is held in the sub-registers of the fifth register, and
the value held in the sub-registers of the fifth register is determined to be a minimum value of the integrated values of the numbers of mismatches.

### Claim 4 (depends on 1)

The calculator according to claim 1,
wherein, when a number of the second vectors to be compared with the first vector is larger than a number of the sub-registers of the second register, the first process to the third process are executed for every group of the second vector having a number equal to the number of the sub-registers of the second register,
a minimum integrated value among the integrated values calculated for every group is held together with identification information corresponding to the second vector having a minimum integrated value in a holding unit, and
a second vector indicated by the identification information corresponding to the minimum integrated value among the integrated values held in the holding unit is determined to be the closest matching vector.

### Claim 5 (depends on 1)

The calculator according to claim 1,
wherein, when a size of at least one of the plurality of second vectors is larger than a size of the first vector,
the size of the first vector is matched to a size of a second vector having a largest size by adding a first logical value to the first vector, and the first vector having the matched size is arranged in the memory, and
a size of an other second vector except for the second vector having the largest size is matched to the size of the second vector having the largest size by adding a second logical value opposite to the first logical value to the other second vector, and the second vector having the matched size is arranged together with the second vector having the largest size in the memory.

### Claim 6 (depends on 5)

The calculator according to claim 5,
wherein, when a number of the second vectors is not dividable by a number of the sub-registers of the register, the second logical value is stored in the sub-registers that do not store the sub-vectors of the second vector.

### Claim 7

A calculation method comprising:
dividing, by a calculator including: a plurality of registers each including a plurality of sub-registers that hold a plurality of pieces of data for use in operation, respectively; an operator that executes, in parallel, operations of the pieces of data held in the plurality of sub-registers, respectively; and a memory that is configured to hold a first vector and a plurality of second vectors to be compared with the first vector, each of the plurality of second vectors into sub-vectors each having a size equal to a size of each of the sub-registers;
sequentially arranging a plurality of sub-vector groups each including the sub-vectors of the plurality of second vectors in a readable manner in the memory in units of sub-vector groups;
repeatedly executing, for all sub-vectors of the first vector, a first process of transferring one of sub-vectors of the first vector held in the memory to a plurality of sub-registers of a first register among the plurality of registers, a second process of transferring the sub-vector group of the plurality of second vectors corresponding to the transferred sub-vector of the first vector to a plurality of sub-registers of a second register among the plurality of registers, the sub-vector group being held in the memory, and a third process of calculating and integrating numbers of mismatches between bit values of the sub-vectors held in the sub-registers corresponding to each other in the first register and the second register; and
determining a second vector in which an integrated value of the calculated numbers of mismatches is smallest to be a closest matching vector.
