So I have 2 switches Representing:

  1. Bit A
  2. Bit B

And then I have :

  • AND gate
  • OR gate
  • Not gate
  • Some other gates like adder and comparator

I used the method described here because the Adder & comparator gates always get the input as 1 however the switch is on or off here. Which is connecting the switch between input to gates and the ground , connect the led between the vcc and the output from gates and it works fine for those 2 gates.

But 3 probems occur now :

  1. For the AND gate nearly work as an OR gate:

     - When the 2 switches off: the led is nearly off though I can still see very
     very low illumination 
     - When either switch is on: led illuminate with full power
  2. For the NOT gate the output is weak and it kinda go and come (like the LED is vibrating but with light effect)

  3. For the OR gate inputs are always seen as 1

     -when switches are closed: lead illuminate nearly with third of its potential 
     - when both are opened: led illuminate with full power.

So is there a way to use those switches correctly ?! I know it is wrong with the switches connection as when i try the input with either with Vcc for 1 or Ground for 0, they work just fine.

  • 1
    \$\begingroup\$ Circuit diagram? Are these TTL devices? I suspect your AND gate is "upside down": NOT (NOT A AND NOT B) == A OR B \$\endgroup\$
    – pjc50
    May 12, 2013 at 14:34

1 Answer 1


It sounds to me that when a switch is open, you have a floating logic input. Logic chips, in general, do not like to have floating inputs and this can produce results like you see (gates half-way on).

Try adding pull-down resistors to your inputs, for example 4.7K between the input and ground. This guarantees that an input always sees a valid logic state.

  • \$\begingroup\$ Ye did that and it working just fine with a pull-down I used 10k but it seems not to work then i used 330 and it worked though the led isn't fully illuminated but at least it works fine, thanks. \$\endgroup\$ May 12, 2013 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.