# US 2018/0321911 A1 · Adder device, data accumulation method and data processing device

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

- Number: US 2018/0321911 A1
- Document ID: US20180321911A1
- Status: Published application
- Kind: A1
- Application number: 15/773,974
- Filed: 2016-06-17
- Published: 2018-11-08
- Earliest claimed: 2015-12-01
- Assignees: Institute of Computing Technology, Chinese Academy of Sciences
- Applicants: Institute of Computing Technology, Chinese Academy of Sciences
- Inventors: Zhen Li; Shaoli Liu; Shijin Zhang; Tao Lou; Cheng Qian; Yunji Chen; Tianshi Chen
- Web page: https://patentgrep.com/patent/US20180321911A1

## CPC

- G06F 7/50: Adding; Subtracting (G06F7/483 - G06F7/491, G06F7/544 - G06F7/556 take precedence)
- G06F 7/501: Half or full adders, i.e. basic adder cells for one denomination
- G06F 7/509: for multiple operands, e.g. digital integrators
- G06N 3/0499: Feedforward networks
- G06N 3/06: Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N 3/063: using electronic means
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06F 2207/4824: Neural networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present disclosure discloses an adder device, a data accumulation method and a data processing device. The adder device comprises: a first adder module provided with an adder tree unit, composed of a multi-stage adder array, and a first control unit, wherein the adder tree unit accumulates data by means of step-by-step accumulation based on a control signal of the first control unit; a second adder module comprising a two-input addition/subtraction operation unit and a second control unit, and used for performing an addition or subtraction operation on input data; a shift operation module for performing a left shift operation on output data of the first adder module; an AND operation module for performing an AND operation on output data of the shift operation module and output data of the second adder module; and a controller module.

## Claims

### Claim 1

An adder device for quickly accumulating an input data stream, comprising:
a first adder module comprising at least one adder tree unit composed of a multi-stage adder array, and a first control unit, every stage of the multi-stage adder array comprising an adder group composed of a plurality of adders, and each of the adder group accumulating input data to form a group of partial sum data as input data of the next-stage adder array, wherein the adder tree unit accumulates input data of every stage by means of step-by-step accumulation to an accumulation sum data as output data of the first adder module based on a control signal of the first control unit;
a second adder module comprising a two-input addition/subtraction operation unit and a second control unit, the two-input addition/subtraction operation unit selectively performing an addition or subtraction operation on input data based on a control signal of the second control unit, and using an addition or subtraction operation result as output data of the second adder module;
a shift operation module connected to the first adder module, for performing a left shift operation on the output data of the first adder module, such that the output data of the first adder module has the same bit width as the output data of the second adder module, and using a shifted result as output data of the shift operation module;
an AND operation module connected to the shift operation module and the second adder module, for performing an AND operation on the output data of the shift operation module and the output data of the second adder module, and using an AND operation result as output data of the adder device; and
a controller module for controlling data input of the first adder module and the second adder module, controlling a shift operation of the shift operation module, and controlling transmission of control signals of the first control unit and the second control unit.

### Claim 2 (depends on 1)

The adder device according to claim 1, wherein,
in the adder tree unit, a register is provided at an output of an adder array in an intermediate stage of the multi-stage adder array for buffering the output data from the output of the adder array in the intermediate stage.

### Claim 3 (depends on 1)

The adder device according to claim 1, wherein,
the first adder module is further provided with a plurality of registers for registering the partial sum data calculated by the adder group, based on the control signal of the first control unit, in which register the partial sum data is registered is determined, and the partial sum in which register among the plurality of registers is added to the accumulation sum data of the adder tree unit as the output data of the first adder module is determined.

### Claim 4 (depends on 1)

The adder device according to claims 1, further comprising:
an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 5 (depends on 2)

The adder device according to claim 2, further comprising:
an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 6 (depends on 3)

The adder device according to claim 3, further comprising:
an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 7 (depends on 1)

The adder device according to claim 1, wherein controller module further comprises:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present; and
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.

### Claim 8 (depends on 2)

The adder device according to claim 2, wherein the controller module further comprises:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present; and
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.

### Claim 9 (depends on 3)

The adder device according to claim 3, wherein the controller module further comprising:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present;
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.

### Claim 10

A method of quickly accumulating an output data stream using an adder device, wherein the adder device for quickly accumulating an input data stream comprises:
a first adder module comprising at least one adder tree unit composed of a multi-stage adder array, and a first control unit, every stage of the multi-stage adder array comprising an adder group composed of a plurality of adders, and each of the adder group accumulating input data to form a group of partial sum data as input data of the next-stage adder array, wherein the adder tree unit accumulates input data of every stage by means of step-by-step accumulation to an accumulation sum data as output data of the first adder module based on a control signal of the first control unit;
a second adder module comprising a two-input addition/subtraction operation unit and a second control unit, the two-input addition/subtraction operation unit selectively performing an addition or subtraction operation on input data based on a control signal of the second control unit, and using an addition or subtraction operation result as output data of the second adder module;
a shift operation module connected to the first adder module, for performing a left shift operation on the output data of the first adder module, such that the output data of the first adder module has the same bit width as the output data of the second adder module, and using a shifted result as output data of the shift operation module;
an AND operation module connected to the shift operation module and the second adder module, for performing an AND operation on the output data of the shift operation module and the output data of the second adder module, and using an AND operation result as output data of the adder device; and
a controller module for controlling data input of the first adder module and the second adder module, controlling a shift operation of the shift operation module, and controlling transmission of control signals of the first control unit and the second control unit,
the method comprising the following steps:
step 1, in which a controller module transmits control signals to a first adder module and a second adder module, to determine values of input data of the first adder module and the second adder module, control a shift operation of a shift operation module, and control transmission of control signals of a first control unit and a second control unit;
step 2, in which after the first adder module and the second adder module receive the control signals from the controller module, respectively, based on the control signal, an adder tree unit of the first adder module accumulates input data of every stage by means of step-by-step accumulation to an accumulation sum data as output data of the first adder module, wherein the first adder module is composed of a multi-stage adder array; the second adder module selectively performs an addition or subtraction operation on input data, and uses an addition or subtraction operation result as the output data of the second adder module;
step 3, in which a shift operation module performs a left shift operation on the output data of the first adder module based on the control signal, such that the output data of the first adder module has the same bit width as the output data of the second adder module, and uses a shifted result as output data of the shift operation module; and
step 4, in which an AND operation module performs an AND operation on the output data of the shift operation module and the output data of the second adder module, and uses an AND operation result as output data of the adder device.

### Claim 11 (depends on 10)

The accumulation method according to claim 10, wherein the step 2 further comprises:
in the adder tree unit, a step of buffering output data from an output of the adder array in an intermediate stage using a register provided at the output of the adder array in the intermediate stage of the multi-stage adder array.

### Claim 12 (depends on 10)

The accumulation method according to claim 10, wherein the step 2 further comprising:
determining, with respect to the registers for registering the partial sum data in the first adder module, in which register the partial sum data is registered, and determining the partial sum data in which register among the plurality of registers is added to the accumulation sum data of the adder tree unit as the output data of the first adder module, based on the control signal of the first control unit.

### Claim 13 (depends on 10)

The accumulation method according to claims 10, further comprising:
detecting, using an overflow detection and overflow processing circuit, whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 14 (depends on 11)

The accumulation method according to claims 11, further comprising:
detecting, using an overflow detection and overflow processing circuit, whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 15 (depends on 12)

The accumulation method according to claims 12, further comprising:
detecting, using an overflow detection and overflow processing circuit, whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 16

A data processing device comprising the adder device, wherein the adder device for quickly accumulating an input data stream comprises:
a first adder module comprising at least one adder tree unit composed of a multi-stage adder array, and a first control unit, every stage of the multi-stage adder array comprising an adder group composed of a plurality of adders, and each of the adder group accumulating input data to form a group of partial sum data as input data of the next-stage adder array, wherein the adder tree unit accumulates input data of every stage by means of step-by-step accumulation to an accumulation sum data as output data of the first adder module based on a control signal of the first control unit;
a second adder module comprising a two-input addition/subtraction operation unit and a second control unit, the two-input addition/subtraction operation unit selectively performing an addition or subtraction operation on input data based on a control signal of the second control unit, and using an addition or subtraction operation result as output data of the second adder module;
a shift operation module connected to the first adder module, for performing a left shift operation on the output data of the first adder module, such that the output data of the first adder module has the same bit width as the output data of the second adder module, and using a shifted result as output data of the shift operation module;
an AND operation module connected to the shift operation module and the second adder module, for performing an AND operation on the output data of the shift operation module and the output data of the second adder module, and using an AND operation result as output data of the adder device; and
a controller module for controlling data input of the first adder module and the second adder module, controlling a shift operation of the shift operation module, and controlling transmission of control signals of the first control unit and the second control unit.

### Claim 17 (depends on 16)

The data processing device according to claims 16, wherein in the adder tree unit, a register is provided at an output of an adder array in an intermediate stage of the multi-stage adder array for buffering the output data from the output of the adder array in the intermediate stage.

### Claim 18 (depends on 16)

The data processing device according to claims 16, wherein the first adder module is further provided with a plurality of registers for registering the partial sum data calculated by the adder group, based on the control signal of the first control unit, in which register the partial sum data is registered is determined, and the partial sum in which register among the plurality of registers is added to the accumulation sum data of the adder tree unit as the output data of the first adder module is determined.

### Claim 19 (depends on 16)

The data processing device according to claims 16, wherein an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 20 (depends on 17)

The data processing device according to claims 17, wherein an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 21 (depends on 18)

The data processing device according to claims 18, wherein an overflow detection and overflow processing circuit for detecting whether an accumulated result of fixed-point numbers has an upward overflow or a downward overflow, if the upward overflow occurs, the operation result is set to the maximum positive number that can be expressed in a fixed-point number format, and if the downward overflow occurs, the operation result is set to the minimum negative number that can be expressed in the fixed-point number format.

### Claim 22 (depends on 16)

The data processing device according to claims 16, wherein the controller module further comprises:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present; and
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.

### Claim 23 (depends on 17)

The data processing device according to claims 17, wherein the controller module further comprises:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present; and
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.

### Claim 24 (depends on 18)

The data processing device according to claims 18, wherein the controller module further comprises:
an operation code control unit for controlling data input of the first adder module and the second adder module;
a device ID control unit for determining a shift value of the shift operation module;
an accumulation source operand ID control unit for determining to select one from the plurality of partial sum registers to be added to an output result of the adder tree;
an enable signal control unit for validating the adder device at present; and
a flag signal control unit for using the output data of the first adder module as the output data of the adder device.
