Comparision Of 8 Bit Binary Numbers

Hi,

I have two 8 bit binary numbers and am looking for some way of detecting which is the largest. What's the best way to go about this? I was thinking of using 2 DACs and then a comparator....Is there a better way?

Cheers,

Michael

Reply to
Michael
Loading thread data ...

"Michael" wrote in message news:PnWhh.18825$ snipped-for-privacy@text.news.blueyonder.co.uk...

There was a CMOS logical chip that used to do this for 4bits..... 4585? (4-bit magnitude comparator) and then you could cascade them for more bits.

DNA

Reply to
Genome

There's a ttl/hcmos part that does this directly. google.

John

Reply to
John Larkin

the 74181 ALU might be ok for this, but I think it went out of production a few years ago. It would take about 5 mins programming on an 8051 etc

martin

Reply to
martin griffith

Got it - 74HC85 Thanks guys

Michael

Reply to
Michael

On a sunny day (Tue, 19 Dec 2006 19:10:47 GMT) it happened "Genome" wrote in :

74HC[T]85
Reply to
Jan Panteltje

Here's one:

formatting link
found at:
formatting link

The %22 are the quotes.

Have Fun! Rich

Reply to
Rich Grise

You've already seen the 4-bit magnitude comparator and the 8-bit equlaity detector in TTL.

The logic is straightforward, and easy to program into a relatively small programmable logic device. I got a 10-bit magntude comparator and a buried 10-bit counter into an ICT7024 in 1993 (with only a little help from my friends).

A Xilinix CoolRunner in a 44-pin package could probably accomodate the comparator and the rest of the digital logic in your system.

--
Bill Sloman, Nijmegen (but in Melbourne at the moment).
Reply to
bill.sloman

The magnitude comparators are used to detect equality only as far as i know. Please tell me if I am wrong.

Rich Grise wrote:

Reply to
jack1981

Texas Instruments 74HC682 It has 2 outputs : = and >

In stock at DigiKey $3.3 / pce

Michael wrote:

Reply to
Jacques

On a sunny day (19 Dec 2006 22:20:37 -0800) it happened snipped-for-privacy@ieee.org wrote in :

I got a 16 bit frame comparator in a PIC in 2000 ;-):

frame_comparator: ;test high byte first movf comparator_high, W subwf frame_8_high, W btfss STATUS, C ;carry if frame_8_high < comparator_high goto f8_smaller ;test if high bytes the same btfss STATUS, Z ;if not same must be greater goto f8_greater_equal ;test low byte movf comparator_low, W subwf frame_8_low, W btfss STATUS, C ;carry if frame_8_low < comparator_low goto f8_smaller f8_greater_equal: bsf fflags, GO_FLAG ;LED on bcf PORTB, LED return

f8_smaller bcf fflags, GO_FLAG ;LED off bsf PORTB, LED return

mmm was not Melbourne burned down recently?

Reply to
Jan Panteltje

A couple of small country towns have lost a few houses, but Melbourne appeared intact when we came in to land, and none of the bits I've visited so far have looked even slightly singed.

There is a drought that has been going on for a few years now, and the reservoirs are down to 40% capacity. My cousin the statistician is involved in the software to monitor the outputs from the new sensors that now measure what rain there is, so it looks as if the politicians are starting to take the situation seriously.

Melbourne may well burn down eventually but it will probably take a few more years of drought to get to the point of being easily inflammable.

--
Bill Sloman, Nijmegen (but in Melbourne at the moment).
Reply to
bill.sloman

You could also use a 2764 EPROM and do a big lookup table. Use the 2 8 bit values as the address bits and then you can either have one or more of the data bits show which byte is bigger or have the largest (or smallest) byte presented on the data out, and you can do it with a 28 pin DIP part. I wouldn't want to do the 65K of values by hand, BUT........

Jim

Reply to
James Beck

And the problem with a plain old table lookup ROM is...?

--
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU\'s LAIR web site at http://www.tinaja.com
Reply to
Don Lancaster

You are wrong (and a top-poster). The 74HC85's have A>B, A

Reply to
Spehro Pefhany

He could use something like an OTP 27C512, but it would be more expensive by several times, require programming, and suck way more juice than a couple 'HC85s.

On the plus side, it would likely be faster, and there would be some left-over outputs which might be useful for some other purpose (for example to compare each input individually to a fixed value).

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Space travel was in my blood. There was nothing I could do about it. I'm on another planet with you, with you, with you..... ooo oooo oooo

Look Nigel, if you want a bacon sandwich you can go and make it yourself. Don't come back. I'll be too busy having a snuggle with the sheets and sharing a washing dream with Genome.

Reply to
Genome

A pint of Smithwicks..

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.