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
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