Skip to main content

4:2 priority encoder

Short answer

4:2 priority encoder (D3 highest). X = D2 + D3, Y = D3 + D1·D2', Valid V = D0+D1+D2+D3. Circuit: OR gate for X, NOT and AND for Y's product term then OR with D3, and 4-input OR for V.

Design the logic circuit for 4:2 Priority Encoder.

A 4:2 priority encoder has four inputs D0D_0–D3D_3 and gives the 2-bit code XYXY of the highest-priority active input. Here D3D_3 has the highest priority and D0D_0 the lowest. A valid bit VV shows that at least one input is 1 (otherwise XYXY is meaningless).

Truth table (X = don't care)

D3D_3D2D_2D1D_1D0D_0XYV
0000XX0
0001001
001X011
01XX101
1XXX111

K-maps (rows D3D2D_3D_2, columns D1D0D_1D_0)

For X:

D3D2D_3D_2 \ D1D0D_1D_000011110
00X000
011111
111111
101111
X=D2+D3X = D_2 + D_3

For Y:

D3D2D_3D_2 \ D1D0D_1D_000011110
00X011
010000
111111
101111
Y=D3+D1D2′Y = D_3 + D_1 D_2'

Valid output:

V=D0+D1+D2+D3V = D_0 + D_1 + D_2 + D_3

Logic circuit

 D3 ------+-----------------[OR]---- X
 D2 ---+--|-----------------^
       |  |
       +-[NOT]--+
 D1 ----------[AND]--+
                     +--[OR]------- Y
 D3 -----------------+

 D0,D1,D2,D3 -------[OR 4]--------- V

Check: D3D2D1D0=0110D_3D_2D_1D_0 = 0110: X=1X = 1, Y=0+1⋅0=0Y = 0 + 1\cdot 0 = 0, so output 1010 = input 2, the highest active one. D3=1D_3 = 1 gives XY=11XY = 11 whatever the others are. All cases were verified against the table.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 4 questions →