Bit manipulation: Difference between revisions

Content deleted Content added
m revert - nothing wrong with the link, but it should not be obfuscated like that
m Broke up first paragraph, edited spelling (in “many-fold speed ups”)
Line 4:
{{refimprove|date=February 2020}}
{{Confuse|Bit banging}}
'''Bit manipulation''' is the act of [[algorithm]]ically manipulating [[bit]]s or other pieces of [[Data (computing)|data]] shorter than a [[Word (data type)|word]]. [[Computer programming]] tasks that require bit manipulation include low-level device control, [[error detection]] and [[error correction|correction]] algorithms, [[data compression]], [[encryption]] algorithms, and [[Optimization (computer science)|optimization]]. For most other tasks, modern [[programming language]]s allow the [[programmer]] to work directly with [[Abstraction (computer science)|abstractions]] instead of bits that represent those abstractions.

[[Source code]] that does bit manipulation makes use of the [[bitwise operation]]s: AND, OR, XOR, NOT, and possibly other operations analogous to the boolean operators; there are also [[bitwise operation#Bit shifts|bit shifts]] and operations to count ones and zeros, find high and low one or zero, set, reset and test bits, extract and insert fields, mask and zero fields, gather and scatter bits to and from specified bit positions or fields.
Integer arithmetic operators can also effect bit-operations in conjunction with the other operators.
 
Bit manipulation, in some cases, can obviate or reduce the need to loop over a data structure and can give many-foldmanyfold speed -ups, as bit manipulations are processed in parallel.
 
== Terminology ==