adilmalik:
do i need pull up or pull down resistors and why?
The dip switch is just an open/close switch, but the signal needs to be HIGH/LOW, not HIGH/undefined
So yes, you need a pulldown, if the swich supplies HIGH when on.
Any unused input pin of an AND gate has to be high, too.
Alternatively, you can supply a signal to more than one pin.