Usually it is implemented by subtraction with the detection of transfer.
From the point of view of gating, the subtraction of binary numbers is performed by transmitting matched pairs of bits from each operand through a subtracter:
+
carry_in
| |
a
| |
b
+
a_minus_b = carry_in ⊕ a ⊕ b
carry_out = (carry_in ∧ b) ∨ (¬a ∧ (carry_in ∨ b))
0 a b _ 0. 1 , carry_in carry_out -0 . , , 1, a < b, 0.
, a_minus_b ORed , , , a = b.
, if (a < b) { ... }.
5 > 3 .