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
| bit | A | B | result |
|---|---|---|---|
| 7 | 1 | 0 | 0 |
| 6 | 0 | 0 | 0 |
| 5 | 1 | 0 | 0 |
| 4 | 1 | 0 | 0 |
| 3 | 0 | 1 | 0 |
| 2 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 0 |