BusOR (Bus OR)
Inputs
| Pin | Type | Description |
|---|---|---|
| A | bus8 | First input bus (8 bits) |
| B | bus8 | Second input bus (8 bits) |
Outputs
| Pin | Type | Description |
|---|---|---|
| Q | bus8 | Bitwise OR: A | B |
How It Works
Each output bit is 1 if either corresponding input bit is 1 (or both). Only 0 | 0 gives 0.
| A Bit | B Bit | Q Bit |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Usage
Setting individual bits: to set bit N to 1 while leaving others unchanged, OR with a mask where only bit N is 1. For example, A | 0x01 sets the LSB (bit 0) to 1.
Combining bus sources: when multiple devices need to drive a shared bus line, OR (or OR-based logic) merges their outputs. Unlike AND, OR allows any source to assert a 1 — useful for interrupt lines and status flags.