# US 8,577,948 B2 · Split path multiply accumulate unit

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

- Number: US 8,577,948 B2
- Document ID: US8577948B2
- Status: Granted
- Kind: B2
- Application number: 12/886,012
- Filed: 2010-09-20
- Published: 2012-03-22
- Granted: 2013-11-05
- Earliest claimed: 2010-09-20
- Assignees: Intel Corporation
- Applicants: Suresh Srinivasan; Rajaraman Ramanarayanan; Sanu K. Mathew; Ram K. Krishnamurthy; Vasantha K. Erraguntla
- Inventors: Suresh Srinivasan; Rajaraman Ramanarayanan; Sanu K. Mathew; Ram K. Krishnamurthy; Vasantha K. Erraguntla
- Web page: https://patentgrep.com/patent/US8577948B2

## CPC

- G06F 9/3893: {controlled in tandem, e.g. multiplier-accumulator}
- 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 9/30014: {with variable precision}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment, a processor includes a multiply-accumulate (MAC) unit having a first path to handle execution of an instruction if a difference between at least a portion of first and second operands and a third operand is less than a threshold value, and a second path to handle the instruction execution if the difference is greater than the threshold value. Based on the difference, at least part of the third operand is to be provided to a multiplier of the MAC unit or to a compressor of the second path. Other embodiments are described and claimed.

## Claims

### Claim 1

An apparatus comprising:
multiply accumulate (MAC) unit to perform a multiply and accumulate operation on first, second and third operands, the MAC unit including:
an exponent compute datapath to determine a difference based on an exponent portion of the first, second, and third operands, the exponent compute datapath having a first compressor to receive the first, second and third operands and to output a first difference having a first portion and a second portion, an adder coupled to the first compressor to generate the difference using the first and second portions of the first difference, a first shifter to shift a mantissa of the third operand by a first amount if the difference is within a threshold range, a second shifter to shift the third operand mantissa by a second amount, and a third shifter to shift the third operand mantissa by a third amount, if the difference is outside the threshold range;
a multiplier including a multiplication tree, wherein the exponent compute datapath is to provide the shifted third operand mantissa to the multiplier if the difference is within the threshold range;
a second compressor to compress an output of the multiplier and the shifted third operand mantissa if the difference is outside the threshold range, wherein the multiplier output is not to be compressed in the second compressor if the difference is within the threshold range;
a first normalizer to normalize the multiplier output if the difference is within the threshold range;
a second normalizer to normalize the second compressor output if the difference is outside the threshold range;
a computation unit to receive the first and second normalizer outputs and to generate a final value for the multiply and accumulate operation therefrom.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the first, second and third shifters are to provide a variable shift amount based on the difference.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the multiplier is not to receive the third operand mantissa if the difference is outside the threshold range.

### Claim 4 (depends on 1)

The apparatus of claim 1, further comprising a leading zero anticipator (LZA) coupled to the multiplier output to determine a number of leading zeros of the multiplier output in parallel with operation of the first normalizer.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the LZA is to further detect a sign for the final value.

### Claim 6 (depends on 5)

The apparatus of claim 5, wherein the computation unit is to perform a completion addition operation to generate the final value using the sign detected by the LZA.

### Claim 7 (depends on 1)

The apparatus of claim 1, further comprising a controller to gate at least the second compressor and the second normalizer if the distance is within the threshold range.

### Claim 8

A processor comprising:
a front end unit to fetch and decode a multiply-accumulate instruction having first, second and third operands associated therewith;
a renamer coupled to the front end unit to allocate at least one of the first, second and third operands to a register of a register file;
a multiply-accumulate (MAC) unit coupled to the renamer and having a first path including a multiplier, the first path to handle execution of the multiply-accumulate instruction if a difference between at least a portion of the first and second operands and the third operand is less than a threshold value, and a second path including a compressor, the second path to handle execution of the multiply-accumulate instruction if the difference is greater than the threshold value, wherein a detector is to receive the difference and to cause a portion of the third operand to be provided to the multiplier of the first path if the difference is less than the threshold value, and otherwise the third operand is to be provided to the compressor of the second path.

### Claim 9 (depends on 8)

The processor of claim 8, wherein the detector is to cause an output of the multiplier to be provided to the compressor if the difference is greater than the threshold value, and otherwise the multiplier output is to be provided to a shifter of the first path.

### Claim 10 (depends on 9)

The processor of claim 9, wherein the MAC unit includes a leading zero anticipator (LZA) coupled to the multiplier output to detect a sign for a result of the multiply-accumulate instruction.

### Claim 11 (depends on 10)

The processor of claim 10, wherein the LZA is coupled to the multiplier output and prior to an addition unit that generates the result.

### Claim 12 (depends on 11)

The processor of claim 11, wherein the LZA is to determine the sign in parallel with normalization of the multiplier output in a second shifter coupled to the multiplier output.

### Claim 13 (depends on 10)

The processor of claim 10, wherein the MAC unit includes a M-bit adder coupled to the multiplier output, the M-bit adder to generate a M×M result using the M-bit adder.

### Claim 14 (depends on 13)

The processor of claim 13, wherein the MAC unit does not include a 2m-bit adder.

### Claim 15 (depends on 10)

The processor of claim 10, wherein a first normalizer coupled to the multiplier output is to normalize the multiplier output if the difference is less than the threshold value, and a second normalizer coupled to an output of the compressor is to normalize the compressor output if the difference is greater than the threshold value.

### Claim 16

A method comprising:
receiving first, second, and third operands in a multiply accumulate (MAC) unit;
determining a difference based on exponents of the first, second, and third operands;
providing at least a portion of the third operand to a multiplier datapath of the MAC unit for accumulation with intermediate results of a multiplication operation on at least a portion of the first and second operands if the difference is within a threshold range; and
otherwise providing the third operand portion to a compressor for accumulation with a product output by the multiplier datapath.

### Claim 17 (depends on 16)

The method of claim 16, further comprising if the difference is within the threshold range, providing the multiplier datapath output to a first normalizer to perform a normalization on the multiplier datapath output in a first direction.

### Claim 18 (depends on 17)

The method of claim 17, further comprising if the difference is outside the threshold range, providing the compressor output to a second normalizer to perform a normalization on the compressor output in a second direction.

### Claim 19 (depends on 17)

The method of claim 17, further comprising determining a sign for a final output from the MAC unit in parallel with performing the first normalization.

### Claim 20 (depends on 16)

The method of claim 16, further comprising if the difference is within the threshold range, powering down a second path of the MAC unit, the second path to be used when the difference is outside the threshold range.
