If you want to read either a 1 or a 0 from an input pin, you simply have the external hardware set the input high or low, then read the input pin. The most common way of doing this is to use a pull up resistor between the input pin and the positive side of the supply, then use a switch to ground the input pin to input a 0 and unground the input pin to input a 1. You can even use a transistor with the collector/emitter junction between the input pin and ground, then use a digital source to pulse the base of the transistor high and low.
If the source of said input is an analog source, then an A/D converter must be used.