Skip to content

Multiply–accumulate operation

A computational recurrence that multiplies two operands and adds the product into a running accumulator, with numeric behavior determined by precision, rounding, overflow, and update semantics.

Version
v3 · 2026-09-06 · History
Domain-specific #
2333
Origin domain
computer science
Subdomain
computer arithmetic
Aliases
MAC operation, Multiply-accumulate

Core Idea

The multiply–accumulate operation, commonly abbreviated MAC, updates a running value by the recurrence

\[ a \leftarrow a + bc. \]

Its identity lies in the feedback role of the accumulator: each product is incorporated into state that is reused by the next update. Repeating the recurrence produces dot products, convolution sums, matrix products, finite-impulse-response filters, and many tensor kernels. Golub and Van Loan expose matrix computation as organized families of products and accumulated sums, making the recurrence a stable algorithmic kernel rather than a particular processor instruction. A single multiplication followed by an unrelated addition is not yet a MAC stream; the defining role is product generation plus accumulation into the designated running state.

Scope of Application

MAC is used wherever streams of pairwise products feed a running sum or state update. Its scope is defined by the recurrence and numeric contract, not by one instruction encoding.

  • Dot products. Corresponding vector elements are multiplied and accumulated.
  • Matrix multiplication. Inner products produce result entries through repeated MAC updates.
  • Convolution and filtering. Samples are multiplied by coefficients and accumulated across a window.
  • Machine learning. Dense, convolutional, and attention kernels organize large populations of MACs.
  • Control and estimation. Weighted state and observation contributions enter recurrent sums.
  • Polynomial evaluation. Horner-like forms can combine multiplication with accumulator updates.
  • Graphics and geometry. Coordinate transforms and shading use repeated weighted sums.
  • Hardware analysis. Throughput, energy, accumulator width, and rounding are assessed around the operation.

Clarity

Specify the recurrence, operand order, accumulator initialization, iteration extent, numeric formats, product precision, accumulator precision, rounding mode, overflow rule, and contraction policy. A claim that a platform performs a MAC should state whether the multiply and add are architecturally fused, merely scheduled together, or computed separately. The mathematical sum and the computed result must be distinguished. In floating-point work, state whether one final rounding or two roundings occur per update and whether reassociation is allowed.

Manages Complexity

MAC isolates the repeated local dependency inside computations that otherwise appear as large algebraic expressions. A matrix product becomes a grid of accumulator states fed by structured operand streams; a convolution becomes repeated coefficient–sample products; a neural layer becomes tensor indexing around the same kernel. This factorization allows separate reasoning about data movement, parallel scheduling, arithmetic precision, and algorithmic meaning. It also reveals failure modes.

Abstract Reasoning

  1. Write the accumulator recurrence and identify which state persists across updates. 2. Declare input, product, and accumulator numeric formats separately. 3. Specify initialization and the exact index or stream extent. 4. Determine whether multiplication and addition round separately or as one fused operation. 5. State overflow, saturation, or modular behavior for bounded formats. 6. Trace operand generation and confirm that every intended pair contributes exactly once.

Knowledge Transfer

The transferable pattern is form a local contribution, incorporate it into persistent state, repeat under an extent and numeric contract. That is why the strict parent is Accumulation. The contribution happens to be multiplicative, and the child carries arithmetic-specific questions of widening, rounding, saturation, fusion, and cancellation. The pattern transfers from DSP to linear algebra and machine learning because those domains supply different operand streams around the same state update. It does not transfer as a prime because replacing the product with an arbitrary contribution yields general accumulation, while removing the persistent state yields an unrelated multiply-add expression.

Relationships to Other Abstractions

Local relationship map for Multiply–accumulate operationParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Multiply–accumulateoperationDOMAINPrime abstraction: Accumulation — is a kind ofAccumulationPRIME

Current abstraction Multiply–accumulate operation Domain-specific

Parents (1) — more general patterns this builds on

  • Multiply–accumulate operation is a kind of Accumulation Prime

    Accumulation is the narrowest accepted prime because every update grows or changes a running aggregate by incorporating one product.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Multiply–accumulate operation sits in a sparse region of the domain-specific corpus (90th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (1565 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08