Main Content

Bit Reduce

AND, OR, or XOR bit reduction on all input signal bits to single bit

  • Bit Reduce block

Libraries:
HDL Coder / Logic and Bit Operations

Description

The Bit Reduce block performs a selected bit-reduction operation (AND, OR, or XOR) on all the bits of the input signal, for a single-bit result.

Ports

Input

expand all

Input signal on which the bit-reduction operation is performed.

  • Minimum bit width: 2

  • Maximum bit width: 128

Data Types: int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Output

expand all

Output signal that is bit-reduced.

Data Types: ufix1

Parameters

expand all

Specifies the reduction operation:

  • AND (default): Perform a bitwise AND reduction of the input signal.

  • OR: Perform a bitwise OR reduction of the input signal.

  • XOR: Perform a bitwise XOR reduction of the input signal.

Programmatic Use

Block parameter: mode
Type: string scalar | character vector
Value: "AND" | "OR" | "XOR"
Default: 'AND'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2014a