I am having a problem assigning bits a value of 0. The data is a 16 bit integer the bits greater than the 12th bit have garbage either a 0 or a 1. I would like to assign all bits greater than 12th bit the value 0 no matter what their values are. Whats the best approach.
There are two schemes of bit numbering - LSB 0 and MSB 0. Both are widely used.
I don't doubt you... but personally I have never seen bit 0 refer to the MSB in my entire life. Probably because most/all of my experience has come from low level hardware register descriptions, binary file format descriptions, C/C++ libraries, and the like.
I've never gone into networking protocols, so I believe you when you say it's commonplace there. It just doesn't seem to be commonplace anywhere else.