← All exercises

Bit Difference

easy

Outputs a word whose bits are set only where the command and feedback words disagree.

What it teaches

Bitwise XOR compares two packed words and marks every disagreement — the readback check that tells maintenance which channel of an output card failed to do what it was told. Unlike a single-BOOL exclusive-OR, each of the 32 bit positions is compared independently.

Inputs and outputs

TagTypeDefaultDescription
In_CommandDINT5Commanded output word
In_FeedbackDINT3Confirmed feedback word
Out_MismatchDINT1 bits mark the channels that disagree

Required behavior