Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logic Gate Question

Status
Not open for further replies.

Borisw37

New Member
I need to create a simple logic gate setup where I have 8 inputs.
The circuit needs to output 1 if more than one input is high.
Otherwise (if 1 input is high, or if no inputs are high) it needs to output 0

Suggestions?
 
You'll probably just need a two bit counter and use bit 1 OR 2 as your output. Trying to do it with combinational logic won't be easy. Or use a 256 bit look up table.
 
Last edited:
How about using an analog approach?

The upper plot panel is like a 4 channel DSO.

The lower plot panel shows the actual voltages at the named nodes.

The comparator is not critical.
 

Attachments

  • DF172.png
    DF172.png
    37 KB · Views: 183
Last edited:
If you can use an analog approach then just sum all the inputs through equal value resistors (one resistor for each input) into a comparator. Select the comparator threshold to about 3/16 of the logic high voltage such that more than one high input triggers the comparator.
 
see the attached, two out of eight selection and then or..
 

Attachments

  • more than two input for output high.JPG
    more than two input for output high.JPG
    28.2 KB · Views: 175
Last edited:
Read my post again!
 
Here's a sequential digital approach:

Connect the signals to the parallel inputs of an 8-bit shift-register.

Periodically clock the shift-register serial output into the clock input of a 4-bit counter.

Use a magnitude comparator to check if the counter total is >1 after all 8-bits of the SR has been output.
 
can be implemented using 4017 with sequential logic as shown.. the high frequency clock will be refreshing the key status, making the 2nd 4017 to set and reset the out put.
 

Attachments

  • 8 key input.JPG
    8 key input.JPG
    62.5 KB · Views: 162
I can't help thinking that a microcontroller would be the solution. One IC and about 20 lines of code.

You could shift the data, and count the 1s that come out as Carl suggested, but do it all in the code.
 
The brute force approach is to OR the outputs of 28 (check my count) 2-input OR gates to check all 2 input combinations of the 8 bits.
 
this should work

I read your question backwards, then put together a schematic. After reading it again and adding a not gate to the output I believe this circuit is all you need. Although a little robust it could be simplified by programming in assembly or using a karnoff map. I believe there a simplified way to karnoff map with a larger number of inputs.
 

Attachments

  • pic.png
    pic.png
    61.7 KB · Views: 158
I read your question backwards, then put together a schematic. After reading it again and adding a not gate to the output I believe this circuit is all you need. Although a little robust it could be simplified by programming in assembly or using a karnoff map. I believe there a simplified way to karnoff map with a larger number of inputs.
I don't believe that will work.

With all inputs low, the output is low. Correct

With inputs 1 and 3 high, the output is high. Correct.

With inputs 1 and 2 high, the output is low. Incorrect.

There are many other sequences of more than one input high that give an incorrect logic low output.
 
Another brute force approach: The are nine conditions to check for the logic input not being true -- all 0's on the input or only one input being 1. This can be done with nine 8-input NOR gates.

For the 8-input NOR gates connect each gate to the 8 logic inputs as follows.
1st gate-- All logic inputs connected directly to the respective gate inputs (all 0 check)
2nd gate --Logic inverter connected to first input, all other inputs connected directly
3rd gate -- Logic inverter connected to second input, all other inputs connected directly
4th gate -- Etc.

The outputs of these nine NOR gates go to a 9-input NOR gate (the Output).

The nine 8-input NOR gates thus determine if all inputs are 0, or if any single input is 1. Those are the conditions for an output 0 (2 or more logic inputs high criteria not met).

Thus if any of the eight gate outputs are 1 then the output NOR gate is 0.

If all of the eight gate outputs are 0 then the 2 or more high criteria is met and the output NOR gate output is 1.

I believe that will work.:)
 
Assuming the receiver (after this circuit) has predefined HI and LO thresholds (especially if those thresholds are close together) it can probably be done with a resistor divider (or a pot) and 8 resistors to the 8 inputs.

That would be a no-gate solution. ;)

Another solution would be a NPN transistor and 8 resistors to it's base and a base resistor to ground. It's collector would pull low when 2 or more inputs are high. It's a very low parts count solution but the output is inverted to what the OP asked for.
 
Another brute force approach: The are nine conditions to check for the logic input not being true -- all 0's on the input or only one input being 1. This can be done with nine 8-input NOR gates.

For the 8-input NOR gates connect each gate to the 8 logic inputs as follows.
1st gate-- All logic inputs connected directly to the respective gate inputs (all 0 check)
2nd gate --Logic inverter connected to first input, all other inputs connected directly
3rd gate -- Logic inverter connected to second input, all other inputs connected directly
4th gate -- Etc.

The outputs of these nine NOR gates go to a 9-input NOR gate (the Output).

The nine 8-input NOR gates thus determine if all inputs are 0, or if any single input is 1. Those are the conditions for an output 0 (2 or more logic inputs high criteria not met).

Thus if any of the eight gate outputs are 1 then the output NOR gate is 0.

If all of the eight gate outputs are 0 then the 2 or more high criteria is met and the output NOR gate output is 1.

I believe that will work.:)

This is exactly same as PRODUCT of SUM. 1st gate is not required. i believe the OP knows this option and wated it more simpler.
 
This is exactly same as PRODUCT of SUM. 1st gate is not required. i believe the OP knows this option and wated it more simpler.
Why is the first gate not required? You want a zero out when all inputs are zero.

So you know what the OP knows. Well, you're a better psychic than I.:rolleyes:
 
More interesting than as I originally read it... If only gates allowed (no micro);
1 answer: takes qty 9, 8 input OR gates along with qty 8, 2 input AND gates.
If this is a homework assignment, the instructor may realize you didn't think of this... Bad Dog, No Biscuit! (teehee) <<<)))
 

Attachments

  • 2_or_more.jpg
    2_or_more.jpg
    12.1 KB · Views: 151
Thanks for the replies.
This is not a homework assignment, just a circuit I'm trying to prototype.
Realizing the number of gates / cost and quantity of components I think it would be easier to do w/ a micro.
Hey, at least it provided a bit of a design challenge for the gurus on the forum :)

Boris.
 
Status
Not open for further replies.

Latest threads

Back
Top