I think I misunderstood you, if the number is an int and its 0110 then when the & operator converts it to binary it won't be the same. instead you should make an unsigned char hold the data and give it the hex form of the number. 0110 = 0x06 in hex and 6 in decimal so:

Code:
unsigned char wall1 = 0x06;
unsigned char test = 0x01; //0001 = 1

if(wall1 & test)....
would get you the right results.