AND Calculator — Bitwise AND Operation
Compute A AND B in one click: enter two integers and see the bitwise AND result with its binary and hex representations side by side.
Bitwise AND — only bits set in both operands appear in the result
Как работи този калкулатор?
Bitwise AND compares two integers bit by bit, outputting 1 only where both bits are 1. For example 12 (1100₂) AND 10 (1010₂) = 8 (1000₂). The result has bits set only where both operands agree. AND is commonly used for masking, flag testing, and bit extraction in programming.
Формула
How this is calculated
Bitwise AND compares two integers bit by bit. At each bit position it outputs 1 if both input bits are 1, and 0 otherwise — so the result can only have bits set where both operands agree. For example 12 (binary 1100) AND 10 (binary 1010) = 8 (binary 1000): only the third bit from the right is 1 in both operands.
Negative numbers are handled using two's complement, which is the standard signed integer representation in virtually all modern hardware and programming languages. In two's complement, AND of two negative numbers can produce a negative result; the binary display uses the two's complement bit pattern for the selected word width.
Common uses of AND include masking (isolating specific bits by ANDing with a mask), checking whether a number is even (n AND 1 equals 0 for even numbers), and clearing individual flag bits in a status register. The result is always ≤ both operands in magnitude for non-negative inputs.
Често задавани въпроси
Bitwise AND operates on corresponding bits of two integers: the output bit is 1 only when both input bits are 1. This differs from logical AND, which returns a single Boolean true/false based on whether two whole values are both non-zero.
AND outputs 1 only when both bits are 1; OR outputs 1 when at least one bit is 1. As a result AND can only clear bits (result ≤ each operand for positives), while OR can only set bits (result ≥ each operand for positives).
Bit masking: to check whether bit k is set in an integer n, compute n AND (1 << k). If the result is non-zero, bit k is 1. To extract the lower 8 bits of a number, AND it with 255 (0xFF). Both operations are fundamental in systems programming and embedded development.
Известен също като
TG we-Calculate Editorial Team. (2026). AND Calculator — Bitwise AND Operation [Online calculator]. TG we-Calculate. https://we-calculate.com/bg/calculator/and-calculator
TG we-Calculate Editorial Team. "AND Calculator — Bitwise AND Operation." TG we-Calculate. 2026. https://we-calculate.com/bg/calculator/and-calculator.
TG we-Calculate Editorial Team, "AND Calculator — Bitwise AND Operation," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/bg/calculator/and-calculator
@misc{wecalculate_and_calculator, title = {AND Calculator — Bitwise AND Operation}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/bg/calculator/and-calculator}}, year = {2026}, note = {TG we-Calculate} }
Помогна ли ви този калкулатор?
