The bitwise AND operation works with the binary representations of integer values. Binary is a base-two number system, so it uses only two digits rather than the ten digits used by the decimal system. Each binary position represents a power of two.
Starting from the right, the positions have values of 1, 2, 4, 8, 16, 32, and so on. Consider the decimal number 13. It can be written as 8 + 4 + 1, which corresponds to binary 1101. Decimal 11 can be written as 8 + 2 + 1, corresponding to binary 1011.
A bitwise AND comparison examines matching positions in these two binary numbers. The operation retains only positions in which both numbers have a 1. The four basic AND rules are simple.
Two zero bits produce zero. A zero and a one produce zero regardless of their order. Two one bits produce one.
Applying these rules independently to every position produces a new binary number. One common use is checking whether particular flags are set in an integer. A program might store several independent yes-or-no conditions within one numerical value. A mask identifies which positions matter, and bitwise AND isolates the positions shared by the stored value and the mask.
This is a mathematical explanation rather than a specification for any particular software interface. The operation is most straightforward for nonnegative integers. It is possible to use signed values, but negative-number behavior depends on the integer representation and, in some environments, a specified bit width.
For introductory calculations, start with nonnegative whole numbers so that the positional interpretation remains clear. The catalog associated with this calculator supplies the action label Calculate. However, the available information does not verify the number of input controls, accepted bases, default values, validation messages, or output display.
The examples here describe how to work through a conventional bitwise AND calculation independently. They should not be interpreted as evidence of particular controls or capabilities in an unverified interface.