# Using on and off switches and logic gates

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.

• Circuit diagram? Are these TTL devices? I suspect your AND gate is "upside down": NOT (NOT A AND NOT B) == A OR B – pjc50 May 12 '13 at 14:34