XOROperator Class


The XOROperator performs Exclusive OR on bits in a value. More...

Header: #include <XOROperator>
Inherits: ArgumentableOperator<OPERATOR_TYPE>

Public Functions

XOROperator(const CDPPropertyBase &in)

Reimplemented Public Functions

virtual std::string GetNodeTypeName() const override
virtual unsigned int Process() override

Additional Inherited Members

Detailed Description

The XOROperator performs Exclusive OR on bits in a value.

XOR has the following truth table:

Input AInput BOutput (A XOR B)


To perform exclusive OR with a signal value, add an XOROperator<unsigned short> into a Signal<unsigned short> in Configure mode. Then go into the XOROperator that was added, add an Argument<unsigned short> and set Value to 5.

How to Run the Example

To run the example from CDP Studio, open Welcome mode and find it under Examples. Next, in Configure mode right click on the system project and select Run & Connect. See the Running the Example Project tutorial for more information.

Set the signal Value containing the XOR operator to 0x0008 (8), and verify that the value after the operator has been applied becomes 0x000D (13)

Member Function Documentation

XOROperator::XOROperator(const CDPPropertyBase &in)

Default constructs an instance of XOROperator.

[override virtual] std::string XOROperator::GetNodeTypeName() const

[override virtual] unsigned int XOROperator::Process()