Illustration of bitwise AND, OR, and XOR operations on binary numbers with logic gate symbols.

Bitwise Operations

Fixed-width bitwise operations

Operands are unsigned integers. Results are masked to the chosen width. Shifts use the shift count (modulo bit width). NOT uses operand A only.

Operation

Operand A

Operand B

Result

Arithmetic right shift treats the value as two’s complement signed before shifting; logical right shift fills with zeros.