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
Bitwise operation
(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!
===NOT=== <!-- linked from redirects [[Bitwise complement]], [[Bit complement]], [[Bitwise NOT]] --> {{See also|Ones' complement}} The '''bitwise NOT''', or '''bitwise complement''', is a [[unary operation]] that performs [[logical negation]] on each bit, forming the [[ones' complement]] of the given binary value. Bits that are 0 become 1, and those that are 1 become 0. For example: NOT '''0'''111 (decimal 7) = '''1'''000 (decimal 8) NOT 10101011 (decimal 171) = 01010100 (decimal 84) The result is equal to the [[two's complement]] of the value minus one. If two's complement arithmetic is used, then <code>NOT x = -x β 1</code>. For unsigned [[Integer (computer science)|integers]], the bitwise complement of a number is the "mirror reflection" of the number across the half-way point of the unsigned integer's range. For example, for 8-bit unsigned integers, <code>NOT x = 255 - x</code>, which can be visualized on a graph as a downward line that effectively "flips" an increasing range from 0 to 255, to a decreasing range from 255 to 0. A simple but illustrative example use is to invert a grayscale image where each pixel is stored as an unsigned integer.
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)