# What would the boolean logic expression be given this condition:

Discussion in 'General Electronics Chat' started by Sebastian Lee, Aug 14, 2016.

1. ### Sebastian Lee Thread Starter New Member

Jul 19, 2016
2
0
Output will be '1' if only two out of three inputs are '1'.

Moderators note: reduced font and removed bold, as it would be like shouting

2. ### Papabravo Expert

Feb 24, 2006
11,163
2,186
Use three 2-input AND gates to detect each input pair being both 1. Use a 3-input OR gate to see if the output of any of the AND gates is 1. If the three inputs are A, B, C, then the Boolean expression is

AB + AC + BC, which will be 1 if any pair of inputs is 1

3. ### WBahn Moderator

Mar 31, 2012
20,256
5,759
But it will also be 1 if all three inputs are 1, which contradicts the stated goal of having the output be 1 if only two out of three inputs are a 1. But this could be just a case of sloppiness on the TS's part, particularly since it would probably be better stated as wanting a 1 only if two of the three inputs are a 1.

@Sebastian Lee: Did you mean exactly two of three, or at least two of three?

If the latter, the circuit is called a "majority detector" or sometimes a "voting circuit".

If you meant the former, then it is almost an even parity detector (which would be a 1 if either exactly zero inputs were 1 or if exactly two inputs are 1. It could be implemented pretty easily starting with either a majority detector or an even parity detector.

Apr 5, 2008
17,156
3,015
Hello,

@WBahn
When it is exact two, it could be an even parity circuit, as it has only 3 bits.

Bertus

5. ### WBahn Moderator

Mar 31, 2012
20,256
5,759
So what is the output of an even-parity circuit when all of the inputs are zero?

Apr 5, 2008
17,156
3,015
Hello,

Ai, I see. with all zeros it will also be 1.

Bertus

7. ### knowone New Member

Aug 24, 2009
3
0
And a bunch of nots.

8. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,660
1,607
#7 is the winner.

ak

9. ### WBahn Moderator

Mar 31, 2012
20,256
5,759
That's IF the TS meant exactly two of the three. There's no way to be sure unless the TS clarifies what the spec is.

10. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,660
1,607
I think "exactly" = "only."

ak