
SpawnLegacy
657
8
2

Equality Checker:
You will need 6 Comparators (2 in subtraction mode), 2 inventories, and 5 torches (3 are used to create an AND gate.
if A-B==0 AND B-A==0: output = 15

Inverse Equality Checker:
You can either use another torch after the AND gate to output 15 if not equal, or you can take an input from 1 of the sides equal to the difference between them.
IF A-B < 0: output = 0
ELSE: output = A-B
IF B-A < 0: output = 0
ELSE: output = B-A

Subtractor:
You will need 2 Comparators (1 in subtraction mode).
Outputs a redstone signal equal to 15 minus the input from the side comparator.