# Multiply-Add

Multiply-add combined operation

**Libraries:**

HDL Coder /
HDL Operations

## Description

The Multiply-Add block computes the product of the first two inputs, a and b, and adds the result to the third input, c. The inputs can be vectors or scalars.

The multiplication operation is full precision, regardless of the output type. The
**Integer rounding mode**, **Output data type**,
and **Saturate on integer overflow** settings apply only to the
addition operation.

Use the Multiply-Add block to map a combined multiply-add or a
multiply-subtract operation to a DSP unit in your target hardware. You can select the
**Function** setting in the Block Parameters dialog box for
the Multiply-Add block.

To map to a DSP unit, specify the `SynthesisTool`

property for your
model. When you generate HDL code for your model, HDL Coder™ configures the multiply-add operation so that your synthesis tool can map
to a DSP unit.

**Note**

Some DSP units do not have the multiply-add capability. To see if your hardware has the multiply-add capability, refer to the documentation for the hardware.

## Limitations

The Multiply-Add block accepts and outputs signals of numeric data type
that Simulink^{®} supports, including fixed-point data types.

You can use matrix data types with the Multiply-Add block. When you use
these types, the port dimensions of the inputs `a`

and
`b`

must match. For example, in MATLAB^{®}, you can perform these matrix
operations:

a = [1 2; 3 4]; b = [5; 6]; c = 7; c + (a.*b)

ans = 12 17 25 31

```
Error in port widths or
dimensions
```

.## Ports

### Input

### Output

## Parameters

## Algorithms

## Extended Capabilities

## Version History

**Introduced in R2015b**