confusion with bitwise

Well, I am probably too new to fully comprehend just how confused I really am......
But I cut and paste the following directly from the Arduino bitwise page here: & - Arduino Reference

//////

.....So if we write PORTD = B00110001; we have made pins 2,3 & 7 HIGH.

....PORTD = PORTD & B00000011; // clear out bits 2 - 7, leave pins 0 and 1 untouched (xx & 11 == xx)

/////

So If I am talking about one specific bit in the collection of eight.....which side do I count from?

thanks.

.So if we write PORTD = B00110001; we have made pins 2,3 & 7 HIGH

No, that would be 0, 4 and 5.

You always start from the least signifigant bit, so that 2^N tells you the value of the bit. Otherwise, bit zero could be 128, 32768 or more depending on the size of the word.

so that 2^N tells you the value of the bit

In a C-rich environment, I prefer to write it 2N.

Ah, so that is what "sup" means in the editor. 8^)

thanks...

OK , that's what i hoped for so that I didnt think I had completely lost it. They should probably fix that, whoever they are.. XD

They should probably fix that, whoever they are..

They" would, if you posted this in the Website and Forum section.

OK, I did.

Are we confusing pins and bits here?

KeithRB:
Are we confusing pins and bits here?

I don't think so. The two statements seem to be counting from opposite ends.