8-input OR as a zero detector — OR gate
corecomplement of the wide AND
Answer
output 1 on 255 of 256 input patterns
Why this example is worth doing
Invert an eight-input OR and you have a zero detector: the output asserts only when every bit of a byte is 0, one pattern in two hundred and fifty-six. That is the Z flag in a processor's status register, computed on every arithmetic result. The page pairs it with the eight-input AND example from the previous page so the symmetry is visible, and notes that both are built as trees for the same delay reason.
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
Truth table
| # | A | B | C | D | E | F | G | H | A + B + C + D + E + F + G + H |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
| 3 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| 4 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 5 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
| 6 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 7 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 8 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 9 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 |
| 10 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 |
| 11 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 |
| 12 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 13 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 14 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
| 15 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| 16 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 |
| 17 | 0 |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