Skip to content
BetterDL

Valid bit

Also called: valid output, V output, valid flag, valid signal, valid output V

An extra priority-encoder output that is 1 when at least one input is active, so an all-zero code can be told apart from no input at all.

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.

YV
0000
0101
1011
1111

Worked examples

Example

A 2-input priority encoder

The diagram is the smallest priority encoder: two inputs, D1 highest. Y is the 1-bit index of the winner.

  1. 1.

    D1 D0 = 00: Y = 0, V = 0. Nothing is active.

  2. 2.

    D1 D0 = 01: Y = 0, V = 1. D0 is active.

  3. 3.

    D1 D0 = 10 or 11: Y = 1, V = 1. D1 wins.

  4. 4.

    Rows 00 and 01 both give Y = 0. Only V tells them apart.

Example

Reading a 4-to-2 priority encoder

D3 is highest. The encoder outputs Y1 Y0 = 01 with V = 1. What could the input be?

  1. 1.

    V = 1, so at least one input is active.

  2. 2.

    Code 01 means D1 won. D1 can only win if D3 and D2 are both 0, and D1 = 1.

  3. 3.

    D0 has lower priority, so it can be anything: the input is 0010 or 0011.

Common mistakes

  • Treating V as part of the code. It's a separate flag; the index is still Y1 Y0.

  • Trusting the code when V = 0. With no active input the code is meaningless, even though it reads 00.

  • Making V = 1 only when exactly one input is active. V is 1 whenever any input is active, however many.

Practice Valid bit

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Valid bit is taught in Combinational Logic.