A priority encoder outputs the index of its winning input. Index 0 is the all-zeros code, 00. But all zeros is also what the encoder outputs when no input is active. Without help, the two cases look identical.
The valid output V solves this. It is simply the OR of all the inputs:
V =
- V = 1: some input is active, and the code is meaningful.
- V = 0: nothing is active. Ignore the code; it carries no information.
So the receiving circuit always checks V first, then reads the code. It works the same way for any size: an 8-to-3 priority encoder has V = OR of D7…D0.
The idea is general. Whenever a code can't express "nothing", you add a separate valid flag. You'll meet the same pattern later as valid bits in caches and status flags in processors.
| Y | V | ||
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |