Multi-Output Multiplexer

Thread Starter

steve2

Joined Feb 6, 2011
3
I'm trying to design a 3 bit number comparer, but I'm not sure how to output what I want since it would be the larger number.

My algorithm is simple:

if (a2 > b2):
return (a2, a1, a0)
else if (b2 > a2)
return (b2, b1, b0)
else if (a1 > b1):
return (a2, a1, a0)
else if (b1 > a1)
return (b2, b1, b0)
else if (a0 > b0)
return (a2, a1, a0)
else:
return (b2, b1, b0)

What type of gate could I use that would allow me to return 3 bits?

Thanks
 

narasimhan

Joined Dec 3, 2009
72
A normal multiplexer is a 1 bit mux which outputs only a single bit. You can use an n-bit mux to output n bits.

Buy I guess a 3 bit comparator requires only a few gates like AND and XNOR. In digital design morris mano book there is an example of 3-bit comparator using gates. Check it out
 

Georacer

Joined Nov 25, 2009
5,182
Oh, I get what you want. Use the output of the suggested circuit to drive a triple 2-to-1 MUX. That will select between your two outputs.

Is that clear?
 
Top