# Equality of two 8 bit buses in 7400 series logic?

Is there a simple way to determine whether two 8-bit buses contain the same value?

I'm currently XORing each bit between the buses then feeding those results into a three-level tree of OR gates. (The top of the tree being a NOR, rather than an OR.)

This is 8x XOR + 6x OR + 1x NOR gates, which is 4x 7400 series chips.

• Use gates with wider inputs. – Eugene Sh. Jun 13 '16 at 19:12
• 74LS85 Qty 2 – Tut Jun 13 '16 at 19:18
• @EugeneSh. ... No, tie the "=" output of one to the "=" input of the next. Use the second "=" output. (I like dim's answer better) – Tut Jun 13 '16 at 19:21
• @EugeneSh. Regarding your first suggestion of "wider inputs" unfortunately there doesn't seem to be a widely available 8-input NOR in the 74 series. Wikipedia mentions a 74HC4078 but it seems to have been discontinued.. – Peter Green Jun 13 '16 at 19:26
• @PeterGreen If we are speaking of a gate-level solution with two input gates, there is a mathematical lower bound on the number of gates to combine 16 inputs into 1 output, and it is 16-1 = 15. – Eugene Sh. Jun 13 '16 at 19:34

Use 74HC688.

If you need something else, be sure to check https://en.m.wikipedia.org/wiki/List_of_7400_series_integrated_circuits.

Note that this 688 can still be sourced easily but most big 74xx building blocks are becoming less and less available. If you have a complex circuit to design, it may be time to learn CPLDs.

• fairchildsemi.com/datasheets/MM/MM74HC688.pdf – user105652 Jun 13 '16 at 19:24
• I happen to know a Company/Freelancer who may or may not go by the name Asmyldof on the internet with a huge collection of DIP 74's, genuine NOS 90's, 80's, 70's and possibly 60's parts. Keep it a secret though, or he'll have ladies calling all day and all night. ;-) – Asmyldof Jun 13 '16 at 20:02
• @Asmyldof Oh so there actually is a way to get some girls with electronics? Nice to know! I'm starting to collect stuff at once. – dim Jun 13 '16 at 20:07
• Well, despite three people fave-ing this chat message it has not had the desired result :'( – Asmyldof Jun 14 '16 at 2:52

the 74HC85 is a 4-bit comparator, and 74HC688 is 8-bit.

• Note that you can chain two or more 74(HC)85s together to compare more than four bits, at the expense of increased propagation delays. – duskwuff -inactive- Jun 13 '16 at 19:29