Discussion:
HELP NEEDED - BIT MASKS
(too old to reply)
Lonewolf3
2003-11-10 11:38:21 UTC
Permalink
Can someone please explain, in simple terms [if poss.] what a BIT MASK
is, and what it does etc.?

I've tried the usual sites and got lost in the terminology used, so
any help would be much appreciated.

Thanx in advance,
Lonewolf3.
Barb Knox
2003-11-10 18:14:18 UTC
Permalink
Post by Lonewolf3
Can someone please explain, in simple terms [if poss.] what a BIT MASK
is, and what it does etc.?
I've tried the usual sites and got lost in the terminology used, so
any help would be much appreciated.
Thanx in advance,
It's bits, used as a mask. That is, it's a sequence of bits, used to
select particular data bits out of another equal-length bit sequence. The
selected data bits are the ones with a 1 in the corresponding mask bit
position; the data bits with a corresponding 0 mask bit are ignored.

Think of masking tape (where the 0 bits cover up parts of the data), or a
costume mask (where the 1 bits are the holes in the mask that expose part
of the underlying face).

HTH.
--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb |
| B B a a r b b |
| BBB aa a r bbb |
-----------------------------
Lonewolf3
2003-11-14 14:56:12 UTC
Permalink
Post by Barb Knox
It's bits, used as a mask. That is, it's a sequence of bits, used to
select particular data bits out of another equal-length bit sequence. The
selected data bits are the ones with a 1 in the corresponding mask bit
position; the data bits with a corresponding 0 mask bit are ignored.
Think of masking tape (where the 0 bits cover up parts of the data), or a
costume mask (where the 1 bits are the holes in the mask that expose part
of the underlying face).
HTH.
Thanx, that's more useful than the techno-babble on other sites.
Lonewolf3
Renganathan Ramamoorthy ::Guru Panguji::
2003-12-05 15:28:42 UTC
Permalink
Hey Lonewolf??

This is how I understood what are bit masks....

They are usually a collection of bits, used to represent the states!
(haha... if that is too general, I will give u a bit of an
explanation).

Say you need to pass the information about the state of many devices
to a single unit. You can do that by sending the entire information of
each device to the unit.

However, that is way too much unnecessary info that you would be
passing. So, a simpler and efficient method of handling it would be to
send the state information of all the deviced to the destination. As
usually a state is designated 1 bit, you could send a collection of
such bits to the destination.
This stream of bits is given the name bit-mask (mask in the sense they
are usually used to hide/show info (interrupt masks... etc)

The state of the nth device (say On=1 and off=0) can be found out by
reading the bit mask and getting the nth bit from the bit mask
(assuming you are starting to read from n=1 to n=n).

As always.
(>::Guru Panguji::<)
http://members.lycos.co.uk/gurupanguji
Post by Lonewolf3
Can someone please explain, in simple terms [if poss.] what a BIT MASK
is, and what it does etc.?
I've tried the usual sites and got lost in the terminology used, so
any help would be much appreciated.
Thanx in advance,
Lonewolf3.
Continue reading on narkive:
Loading...