Addendum: I just noticed that the 74ls85 works as a 4-bit magnitude comparator, and has three comparison modes: A = B, A > B, and A < B. I guess this chip could also be used as part of this idea (instead of the less common 74ls686 8-bit comparator) Michael B.