Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mask (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Masking bits to <code>1</code>=== To turn certain bits on, the [[Logical disjunction|bitwise <code>OR</code>]] operation can be used, following [[Logical disjunction#Bitwise operation|the principle]] that for an individual bit '''Y''', <code>Y OR 1 = 1</code> and <code>Y OR 0 = Y</code>. Therefore, to make sure a bit is on, <code>OR</code> can be used with a <code>1</code>. To leave a bit unchanged, <code>OR</code> is used with a <code>0</code>. Example: Masking ''on'' the higher [[nibble]] (bits 4, 5, 6, 7) while leaving the lower nibble (bits 0, 1, 2, 3) unchanged. '''1001'''0101 '''1010'''0101 OR '''1111'''0000 '''1111'''0000 = '''1111'''0101 '''1111'''0101
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)