LogicBinaryOpCombination
Overview
Performs logical operations on binary signals
Discussion
This module can compute multiple binary operations sequentially and write the result in a defined output channel. The output is then a channel integer signal that is formed as the binary operation applied over defined input and output channels.
For example: Out[0] = ( ( ( In[1]&In[3] ) | In[0] ) & In[2] ). The array variable .binaryOpConfig determines the type of binary operation. Possible values are: 0 = AND, 1 = OR, 2 = XOR, 3 = NAND, 4 = NOR, 5 = XNOR. The binary operation is applied on a bit-by-bit basis to the 32-bit signals. 6 = CONST copies the value from the input to the output. Column 1 contains the input channel index (zero-based). Column 2 contains the output channel index (zero-based). Column 3 specifies which binary operation should be performed
This module supports only control data of block size = 1.
Type Definition
typedef struct _ModuleLogicBinaryOpCombination
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numOut; // Number of output channels
INT32 numOps; // Number of binary operations to be computed
INT32 defaultOut; // Defines the default output value for unsused channels
INT32* binaryOpConfig; // Column 1: Input channel index, Column 2: Output channel index, Column 3: AND=0, OR=1, XOR=2, NAND=3, NOR=4, XNOR=5, CONST=6. Selects the type of binary operations that is performed.
} ModuleLogicBinaryOpCombinationClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numOut | int | const | 0 | 1 | Unrestricted | Â |
numOps | int | const | 0 | 1 | Unrestricted | Â |
defaultOut | int | parameter | 0 | 0 | 0:1 | Â |
binaryOpConfig | int* | parameter | 0 | [1 x 3] | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: Control input
Data type: int
Channel range: Unrestricted
Block size range: 1
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Control output
Data type: int
MATLAB Usage
File Name: logic_binary_op_combination_module.m
Creates a module that performs Boolean binary operations (AND, OR, XOR)
on one or more integer values.
The module performs the operation on a block-by-block basis. The third
argument specifies how many operations are performed.
The module has one input pin with an arbitrary number of interleaved
channels and one output pin with a user defined number of channels.
Arguments:
NAME - name of the module.
NUMOUT - number of output channels. By default 5.
NUMOPS - number of operations to compute. By default 5.
Copyright 2022 DSP Concepts, Inc. All Rights Reserved.
AudioWeaverModule [This tag makes it appear under awe_help]
Â