Pull-up resistor - why input pin is pulled to ground when the switch is closed?
Actually, to confuse you more..

One, is current going into the pin, and Zero is current coming out of the pin. For one you have to supply the correct current to maintain the input at a high enough voltage. For a low you have to extract enough current to keep the input voltage low enough.

When the switch is open,  a small current flows into pin 1 and eventually ends at ground through the device. If the resistor is not too large, the voltage drop across the resistor will be small and the voltage at the pin will be near Vcc, or more accurately, high enough above the high level logic threshold.







simulate this circuit &ndash; Schematic created using CircuitLab

When the switch is closed, obviously current is flowing through the resistor to ground, but there is another simultaneous current path from Vcc through the device, out the pin, through the switch to ground. Since, with a switch, the pin is hard connected to ground, the voltage at the pin will be zero volts with respect to that ground. 







simulate this circuit

Notice when the switch is closed the resistor does nothing useful for the power it is dissipating.

For a standard (non CMOS) TTL device the zero logic level current coming out of the pin is MUCH larger than the high level current that enters the pin. For CMOS parts the high level and low level currents are almost equivalent and very small since all they do is maintain the charge, or lack of charge, on the input capacitance of the device.