Bitwise OR: 1011 0110 | 0000 1111 — OR gate

coresetting the low nibble

Answer

10111111

Why this example is worth doing

Bitwise OR with a mask sets bits rather than clearing them, which is the complementary operation to the AND mask on the previous page — AND with a 0 clears, OR with a 1 sets, and XOR with a 1 toggles. The page presents all three as one table because they are almost always taught separately and then confused. Setting the low nibble here turns B6 into BF, which the linked base converter shows in hex.

Try your own input in the OR 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

result10111111

Column by column — columns bit, A, B, result
bitABresult
7101
6000
5101
4101
3011
2111
1111
0011

Compare with

Open the OR 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