Pls help with logic gate

Papabravo

Joined Feb 24, 2006
22,082
Why do you have to connect the inputs pins to ground? Isnt it enough with the buton?
In using a CMOS gate, ALL PINS must be connected to a valid voltage level at all times. Leaving an input floating will allow it to assume ANY level between Vcc and GND. The result is erratic and unpredictable behavior.
 

dl324

Joined Mar 30, 2015
18,326
Welcome to AAC!

When the switches are opened, the inputs would be floating. The logic state of floating inputs is indeterminate.
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Another question, if the button is pressed woudn't there be a shortcircuit passing through the 10k resistor?
 

dl324

Joined Mar 30, 2015
18,326
Another question, if the button is pressed woudn't there be a shortcircuit passing through the 10k resistor?
We don't consider a desired connection a short.

The inputs of CMOS logic gates can be tied to VCC or GND without problem.

Without the 10k resistor, the switch would create a short between VCC and GND.
 

crutschow

Joined Mar 14, 2008
38,504
Another question, if the button is pressed woudn't there be a shortcircuit passing through the 10k resistor?
A short is considered to be a zero or very low resistance connection.
The switch could be considered to be that when pressed.
But the 10kΩ resistor limits the current to less than a mA for the applied 9V, so is not considered to be a short.
 
Top