Electrical – designing a 3-bit comparator using only multiplexers

comparatormultiplexer

I need to design a 3 bit comparator using only multiplexers specifically 74ls153 and/or 74ls151. I've already constructed the truth table(see below) and realized that A=B is not needed since its inferred when both A > B & A < B are equal. My thought process has me using three 74ls153's to compare pairs of bits starting with the LSB and working my way up to MSB. One "side" of the mux is wired to output A>B and the other "side" wired for B>A.

I am

a) unsure how to carry these outputs to the next multiplexer / final multiplexer

b) how to convert this to a 2-bit output

I'm not looking for an outright answer, more so a point in the right direction with a better understanding.

enter image description here

Best Answer

I believe it is simpler to use the 74ls151. This is an 8 to 1 mux. You have 8 inputs that you can select one at a time. So if you apply the 3 A bits to the select pins, the (single) output will "follow" the corresponding (D0 to D7) input level. Since the bits are equal when they are all 0 or 1, this means that the output will follow D0 (000) or D7 (111). These inputs (D0, D7) are tied HI, and the others tied low. This way, when the bits are 000 or 111, the output will be HI. The same is done with the B bits.

I leave it up to you, how to use the third mux, to provide a HI output when outputs of the other two mux are equal.