So basically I'm trying to design the circuit for a BCD code detector which should have 4 inputs and gives an output of 1 if the equivalent decimal is 0<=input<=9. Else, it should give zero.
Now as I understand it(although not sure) the physical circuit using LED and resistors alongside the NAND gates, should light up when the output is 1 and off when the equivalent digital output is 0.
Edit: the DCBA are simply the four digits binary input. With b corresponding to the most significant bit and A as the LSB. Now the circuit has worked as the answer below described but only if the DIP switch is rotated 180 degrees. Why though??? shouldn't a switch act as a short or open circuit and thus no matter how it's rotated, it's either on or off.