# ALUMODE Inputs

## Versal ACAP DSP Engine Architecture Manual (AM004)

Document ID
AM004
Release Date
2022-09-11
Revision
1.2.1 English

The 4-bit ALUMODE controls the behavior of the second stage adder/subtracter/logic unit. ALUMODE = `0000` selects add operations of the form Z + (W + X + Y + CIN). CIN is the output of the CARRYIN MUX (see Figure 1). ALUMODE = `0011` selects subtract operations of the form Z – (W + X + Y + CIN). ALUMODE = `0001` can implement –Z + (W + X + Y + CIN) – 1. ALUMODE = `0010` can implement –(Z + W + X + Y + CIN) – 1, which is equivalent to not (Z + W + X + Y + CIN). The negative of a two’s complement number is obtained by performing a bitwise inversion and adding one, for example, –k = not (k) + 1.

Table 1. Four-Input ALUMODE Operations
DSP Operation OPMODE[8:0] ALUMODE[3:0]
3 2 1 0
Z +W + X + Y + CIN Any legal OPMODE `0` `0` `0` `0`
Z – (W + X + Y + CIN) Any legal OPMODE `0` `0` `1` `1`
–Z + (W + X + Y + CIN) – 1 = not (Z) + W + X + Y + CIN Any legal OPMODE `0` `0` `0` `1`

not (Z +W + X + Y + CIN) =

–Z – W – X – Y – CIN – 1

Any legal OPMODE `0` `0` `1` `0`
1. In two’s complement, –Z = not (Z) + 1.
2. X + Y = –M, the two’s complement negation of the product, when NEGATE = 1 and OPMODE[3:0] = `4’b0101`.