Skip to main content

Octal priority encoder design

Short answer

The encoder outputs 3-bit binary code of the highest active input (D7 highest priority) and a valid bit V = D0+...+D7. Y2 = D4+D5+D6+D7; Y1 = D7+D6+D5'D4'D3+D5'D4'D2; Y0 = D7+D6'D5+D6'D4'D3+D6'D4'D2'D1. Uses AND and OR gates with inverters.

Design the operation of octal priority encoder with neat diagram.

An octal (8-to-3) priority encoder has eight inputs D0D_0–D7D_7 and three outputs Y2Y1Y0Y_2Y_1Y_0 giving the binary code of the highest-numbered active input (D7D_7 = highest priority). A valid output VV is 1 when any input is active. The 74148 is a common IC (active-low).

Truth table (X = don't care)

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0Y2Y_2Y1Y_1Y0Y_0V
00000000XXX0
000000010001
0000001X0011
000001XX0101
00001XXX0111
0001XXXX1001
001XXXXX1011
01XXXXXX1101
1XXXXXXX1111

Output equations

Write each output as the OR of the rows where it is 1; each row requires all higher inputs to be 0, and redundant conditions are dropped.

  • Y2=1Y_2 = 1 for highest input 4, 5, 6 or 7:
Y2=D4+D5+D6+D7Y_2 = D_4 + D_5 + D_6 + D_7
  • Y1=1Y_1 = 1 for highest input 2, 3, 6 or 7. Inputs 2 and 3 count only if D4=D5=0D_4 = D_5 = 0 (if D6D_6 or D7D_7 is 1, Y1Y_1 is 1 anyway):
Y1=D7+D6+D5′D4′D3+D5′D4′D2Y_1 = D_7 + D_6 + D_5'D_4'D_3 + D_5'D_4'D_2
  • Y0=1Y_0 = 1 for highest input 1, 3, 5 or 7:
Y0=D7+D6′D5+D6′D4′D3+D6′D4′D2′D1Y_0 = D_7 + D_6'D_5 + D_6'D_4'D_3 + D_6'D_4'D_2'D_1
  • Valid bit:
V=D0+D1+⋯+D7V = D_0 + D_1 + \dots + D_7

Logic diagram

 D4,D5,D6,D7 ----------------------[OR 4]--- Y2

 D7 ---------------------------+
 D6 ---------------------------+
 D5',D4',D3 ---[AND 3]---------+--[OR 4]--- Y1
 D5',D4',D2 ---[AND 3]---------+

 D7 ---------------------------+
 D6',D5 -------[AND 2]---------+
 D6',D4',D3 ---[AND 3]---------+--[OR 4]--- Y0
 D6',D4',D2',D1 [AND 4]--------+

 D0 ... D7 ------------------------[OR 8]--- V

Inverters provide D2′,D4′,D5′,D6′D_2', D_4', D_5', D_6'.

Operation

When several keys or interrupt lines are active together, only the highest one is encoded. Example: D6=D3=D1=1D_6 = D_3 = D_1 = 1, others 0. Then Y2=1Y_2 = 1, Y1=1Y_1 = 1 (from D6D_6), Y0=0Y_0 = 0 (since D6′=0D_6' = 0 blocks all Y0Y_0 terms and D7=0D_7 = 0). Output 110=6110 = 6 and V=1V = 1. All 255 non-zero input patterns were checked against these equations.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 4 questions →