Flip before you compare
What if we could flip B before it reaches the AND gate?
Turn the 0 into a 1, so that AND can recognize it.
We do have a gate for that. The NOT gate flips a value.
0 becomes 1, 1 becomes 0.
Pass B through NOT first. B=0 becomes 1.
Now AND sees A=1 and NOT B=1. It fires. Correct.
Check every other case:
A=0 B=1: NOT B=0, AND outputs 0.
A=1 B=1: NOT B=0, AND outputs 0.
A=0 B=0: NOT B=1, AND outputs 0. All correct.
A AND (NOT B). Two gates. That's "is A bigger than B?"