# US 2022/0283778 A1 · Method and device for encoding

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

- Number: US 2022/0283778 A1
- Document ID: US20220283778A1
- Status: Published application
- Kind: A1
- Application number: 17/401,453
- Filed: 2021-08-13
- Published: 2022-09-08
- Earliest claimed: 2021-03-04
- Assignees: Samsung Electronics Co., Ltd.; Korea Advanced Institute of Science and Technology
- Applicants: Samsung Electronics Co., Ltd.; Korea Advanced Institute of Science and Technology
- Inventors: Yeongjae CHOI; Seungkyu CHOI; Lee-Sup KIM; Jaekang SHIN
- Web page: https://patentgrep.com/patent/US20220283778A1

## CPC

- G06F 7/4876: {Multiplying}
- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F 2207/4824: Neural networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An encoding method includes receiving input data represented by a 16-bit half floating point, adjusting a number of bits of an exponent and a mantissa of the input data to split the input data into 4-bit units, and encoding the input data in which the number of bits has been adjusted such that the exponent is a multiple of “4”.

## Claims

### Claim 1

An encoding method, comprising:
receiving input data represented by a 16-bit half floating point;
adjusting a number of bits of an exponent and a mantissa of the input data to split the input data into 4-bit units; and
encoding the input data in which the number of bits has been adjusted such that the exponent is a multiple of “4”.

### Claim 2 (depends on 1)

The encoding method of claim 1, wherein adjusting of the number of bits comprises:
assigning 4 bits to the exponent; and
assigning 11 bits to the mantissa.

### Claim 3 (depends on 1)

The encoding method of claim 1, wherein the encoding comprises:
calculating a quotient and a remainder obtained when a sum of the exponent of the input data and “4” is divided by “4”;
encoding the exponent based on the quotient; and
encoding the mantissa based on the remainder.

### Claim 4 (depends on 3)

The encoding method of claim 3, wherein encoding of the exponent comprises encoding the exponent based on the quotient and a bias.

### Claim 5 (depends on 3)

The encoding method of claim 3, wherein encoding of the mantissa comprises determining a first bit value of the mantissa to be “1” if the remainder is “0”.

### Claim 6 (depends on 3)

The encoding method of claim 3, wherein encoding of the mantissa comprises determining a first bit value of the mantissa to be “0” and a second bit value of the mantissa to be “1”, if the remainder is “1”.

### Claim 7 (depends on 3)

The encoding method of claim 3, wherein encoding of the mantissa comprises determining a first bit value of the mantissa to be “0”, a second bit value of the mantissa to be “0”, and a third bit value of the mantissa to be “1”, if the remainder is “2”.

### Claim 8 (depends on 3)

The encoding method of claim 3, wherein encoding of the mantissa comprises determining a first bit value of the mantissa to be “0”, a second bit value of the mantissa to be “0”, a third bit value of the mantissa to be “0”, and a fourth bit value to be “1”, if the remainder is “3”.

### Claim 9 (depends on 1)

A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the encoding method of claim 1.

### Claim 10

An operation method, comprising:
receiving first operand data represented by a 4-bit fixed point;
receiving second operand data that are 16 bits wide;
determining a data type of the second operand data;
encoding the second operand data, if it is determined the second operand data are of a floating-point type, and splitting the encoded second operand data into four 4-bit bricks;
splitting the second operand data into four 4-bit bricks for a parallel data operation, if it is determined the second operand data are of a fixed-point type; and
performing a multiply-accumulate (MAC) operation between the second operand data split into the four bricks and the first operand data.

### Claim 11 (depends on 10)

The operation method of claim 10, wherein the encoding comprises:
adjusting a number of bits of an exponent and a mantissa of the second operand data, so as to split the second operand data into 4-bit units; and
encoding the second operand data in which the number of bits is adjusted such that the exponent is a multiple of “4”.

### Claim 12 (depends on 10)

The operation method of claim 10, wherein the splitting comprises splitting the encoded second operand data into one exponent brick data and three mantissa brick data.

### Claim 13 (depends on 12)

The operation method of claim 12, wherein performing of the MAC operation comprises:
performing a multiplication operation between the first operand data and each of the three mantissa brick data;
comparing the exponent brick data with accumulated exponent data stored in an exponent register; and
accumulating a result of performing the multiplication operation to accumulated mantissa data stored in each of three mantissa registers, based on a result of the comparing.

### Claim 14 (depends on 13)

The operation method of claim 13, wherein the accumulating comprises aligning accumulation positions of the result of performing the multiplication operation and the accumulated mantissa data stored in each of the three mantissa registers, based on the result of the comparing.

### Claim 15

An encoding device, comprising:
a processor configured to receive input data represented by a 16-bit half floating point, adjust a number of bits of an exponent and a mantissa of the input data to split the input data into 4-bit units, and encode the input data in which the number of bits has been adjusted such that the exponent is a multiple of “4”.

### Claim 16 (depends on 15)

The encoding device of claim 15, wherein the processor is further configured to assign 4 bits to the exponent and assign 11 bits to the mantissa.

### Claim 17 (depends on 15)

The encoding device of claim 15, wherein the processor is further configured to calculate a quotient and a remainder obtained when a sum of the exponent of the input data and “4” is divided by “4”, encode the exponent based on the quotient, and encode the mantissa based on the remainder.

### Claim 18

An operation device, comprising:
a processor configured to receive first operand data represented by a 4-bit fixed point, receive second operand data that are 16 bits wide, determine a data type of the second operand data, encode the second operand data, if it is determined the second operand data are of a floating-point type and split the encoded second operand data into four 4-bit bricks, split the second operand data into four 4-bit bricks for a parallel data operation, if it is determined the second operand data are of a fixed-point type, and perform a multiply-accumulate (MAC) operation between the second operand data split into the four bricks and the first operand data.

### Claim 19 (depends on 18)

The operation device of claim 18, wherein the processor is further configured to adjust a number of bits of an exponent and a mantissa of the second operand data, so as to split the second operand data into 4-bit units, and encode the second operand data in which the number of bits is adjusted such that the exponent is a multiple of “4”.

### Claim 20 (depends on 18)

The operation device of claim 18, wherein the processor is further configured to split the encoded second operand data into one exponent brick data and three mantissa brick data.

### Claim 21 (depends on 20)

The operation device of claim 20, wherein the processor is further configured to perform a multiplication operation between the first operand data and each of the three mantissa brick data, compare the exponent brick data with accumulated exponent data stored in an exponent register, and accumulate a result of performing the multiplication operation to accumulated mantissa data stored in each of three mantissa registers, based on a result of the comparing.

### Claim 22 (depends on 21)

The operation device of claim 21, wherein the processor is further configured to align accumulation positions of the result of performing the multiplication operation and the accumulated mantissa data stored in each of the three mantissa registers, based on the result of the comparing.

### Claim 23

An operation method, comprising:
receiving first data represented by a 4-bit fixed point;
receiving second data that are 16 bits wide;
encoding the second operand data, in a case in which the second operand data are of a floating-point type, and splitting the encoded second operand data into four 4-bit bricks;
splitting the second operand data into four 4-bit bricks without encoding the second operand data, in a case in which the second operand data are of a fixed-point type; and
performing a multiply-accumulate (MAC) operation between the split second operand data and the first operand data.
