So, I understand how to read bits.
0b1 = 1
0b10 = 2
0b100 = 4
What I don't understand is how 0b111 & 0b1010 = 0b10.
See, when I looked at the tutorial, I figured it would be like this.
Because 1 & 1 = 1 and anything else turns the value into 0. Can someone explain this to me? Am I simply lining up the values wrong? Like, should I translate 0b111 to 0b0111 to make sure things line up well because that 0 at the end has no pair?
0b0010 which then equals to 0b10 which is supposedly the correct answer?
I just want to make sure that I'm doing this correctly from the beginning. Thank you guys in advance!