|
Joe, thank you very much for that thorough explanation. I believe I mostly understand this now. Thanks also for saving me the research into which hex values correspond to the bit values to be tested. And thanks to everyone else who provided insight into this issue for me. It's most appreciated. Donald R. Fisher, III Project Manager Roomstore Furniture Company (804) 784-7600 extension 2124 DFisher@xxxxxxxxxxxxx <clip> So, let's look at a couple more examples: B'0001 0000' AND B'0001 0000' = B'0001 0000' B'0001 1111' AND B'0001 0000' = B'0001 0000' B'0101 0101' AND B'0001 0000' = B'0001 0000' B'1111 1111' AND B'0001 0000' = B'0001 0000' Get the idea? Basically, the AND strips out anything except where you have bits on in the mask. So, in this particular case, as long as bit one is on, the result will be B'0001 0000'. Similarly, anything with bit one off will end up as B'0000 0000': B'0000 0000' AND B'0001 0000' = B'0000 0000' B'0000 1111' AND B'0001 0000' = B'0000 0000' B'0000 0101' AND B'0001 0000' = B'0000 0000' B'1110 1111' AND B'0001 0000' = B'0000 0000' Because there is only one bit on in your mask, there are only two possible results: if bit three is on, the result is B'0001 0000', if bit three is off, the result is B'0000 0000'. <clip>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.