Bitwise AND: 1011 0110 & 0000 1111 — AND gate

coremasking the low nibble

Answer

00000110

Why this example is worth doing

The same gate applied to eight bit-pairs in parallel, which is what the AND instruction in every processor does. Choosing a mask of 0000 1111 keeps the low four bits and clears the rest, and that operation — masking — is by far the most common real use of AND outside a logic course. The page shows the column-by-column working and links to the number-base converter so the same value can be read in hex, where the mask is simply 0F.

Try your own input in the AND gate. Truth table, symbol and algebraic form for A·B, with a live two-input toggle.

How the answer is reached

Column by column

A10110110

B00001111

result00000110

Column by column — columns bit, A, B, result
bitABresult
7100
6000
5100
4100
3010
2111
1111
0010

Compare with

Open the AND gate

This input is entered in the tool itself — it is too rich for a link to carry.

Note:

Notation this page assumes

  • Symbols: · is AND, + is OR, ⊕ is XOR, a prime or an overline is NOT. The field also takes ∧ ∨ ¬ ~ ! & | and the words.
  • Operator precedence, tightest first: NOT, then AND (including juxtaposition), then XOR/XNOR, then NAND/NOR, then OR, then IMPLIES, then IFF.
  • Gate symbols follow whichever standard the header toggle is set to: ANSI/IEEE Std 91-1984 distinctive shapes, or IEC 60617-12 rectangles.

Sources

  • ANSI/IEEE Std 91-1984, Graphic Symbols for Logic Functions
  • IEC 60617-12, Graphical Symbols for Diagrams — Binary Logic Elements