Wiki

This version (06 Nov 2013 21:37) was approved by Brett Gildersleeve.

Bitwise Logic - And, Or, Nand, Nor, Xor

Click here to return to the Basic DSP page


The Bitwise Logic block applies one of five selectable logic operations to each bit of the two input signals and outputs the result on the output pin. And, Or, Nand, Nor, and Xor operators are available.

Unlike the normal Logic - And, Or, Nand, Nor cell, which applies the logic operation to the full data word from each input, this cell applies the logic operation to each bit in each word. The first bit in each of the two words are used to create the first bit in the output word, the second bit in each of the two words are used to create the second bit in the output word, and so on.

To change the operator: Left click on the icon button, each click will toggle the active operator which is shown in the icon image and label.

Note: the operator is a compile time settings you will have to compile and download the project each time you change the operator.

Example

In the following example, the words 0x000000AA and 0x0000000F have the AND logic operator applied to them. The resulting output is 0x0000000A.

bitwiselogicexample.jpg

resources/tools-software/sigmastudio/toolbox/basicdsp/bitwiselogicandornandnor.txt · Last modified: 06 Nov 2013 20:47 by Brett Gildersleeve