Let's work out the pull-up circuit. And even though it's not stated, let's say that the switch has a resistance of 1 ohm. This is usually a much-higher resistance than most switches, but we'll play it safe and call it 1 ohm. Let's also assume that the input to R1 (100ohm resistor) is ideal with zero source impedance, and can be either 0V or 5V. The output is where all three components meet.
-Case 1 - Input is 5V, switch open: In this case, you have 5V supplying both resistor, so it is the same as if both resistors are in parallel and being feed from 5V. A 100 ohm and a 10 kohm resistor in parallel works out to a single 99 ohm resistor. So as long as the ouput has a resistance of at least 99 ohms, the output will be 2.5V or greater. If the output load is say 1 kohm to common, the output will be about 4.5V, a definite logic high.
-Case 2 - Input is 0V, switch open: Now the circuit is the same as a 10 kohm and a 100 ohm in series, going from 5V to common. The 10k will drop 100 times the voltage as the 100 ohm, so the unloaded output voltage will be 0.0495V, a definite logic low. If you add a 1 kohm load resistance and recalculate, the output will be even a bit lower (something like 0.045 or so) and still a definite logic low.
-Case 3 - Input is 5V, 1 ohm switch closed - Now you have something similar to Case 1, but with a 1 ohm resistor to common from the output. Total, you have a 99 ohm resistor in series with a 1 ohm resistor, connected from 5V to common. That works out to an output of 0.05V, definite logic low. And if you add ANY load resistance, the output will be even lower and still a logic low.
-Case 4 - Input is 0V, 1 ohm switch closed - works out to an even lower output voltage, still definite logic low.
Like I said, most mechanical switches are much lower than 1 ohm, so when closed, your output will actually be lower, like in the microvolt range rather than the millivolt range above. So yes, there is some voltage drop across the switch when closed, but it is such a low value that it virtually is an ideal, zero-ohm connection. An ideal zero-ohm switch, of course, will yield a zero-volt output when closed, no matter what the inputs are.
Doing the same sort of analysis on the pull-down circuit will give similar results. Outputs may not be exactly either zero or 5 volts, but will be so close to one or the other as to be virtually the same.
As far as the values of the resistors, these are pretty typical values for TTL logic, and based on -
- The output load resistance, which for a TTL input could be something like abut 1 megohm, and
- The drive capability of the input, which could be something like up to 30 milliamps for TTL
To actually select the resistor values, you consider both, as well as the switching threshold of the load (as in, supply no more than say 1 volt for a logic low and at least 4 volts for a logic high).