← All exercises

Compare Pair

easy

Output Less, Equal, and Greater flags by comparing two numeric inputs.

What it teaches

The configurable cousin of Sign Check. Compare two arbitrary numbers and produce three separate flags. Same shape, but the reference value is now an input instead of a fixed zero.

Inputs and outputs

TagTypeDefaultDescription
In_AREALFirst input value
In_BREALSecond input value
Out_LessBOOLLess flag
Out_EqualBOOLEqual flag
Out_GreaterBOOLGreater flag

Required behavior

  • Out_Less is 1 when In_A is strictly less than In_B.
  • Out_Equal is 1 when In_A exactly equals In_B.
  • Out_Greater is 1 when In_A is strictly greater than In_B.