# design a 8 to 3, valid output - priority encoder with AND,OR,NOT Gates

I'm trying to implement a 8 to 3 priority encoder which worked quiet well.

My function for the three outputs are:

$$A_0 = e_1 + e_3 + e_5 + e_7$$ $$A_1 = e_2 + e_3 + e_6 + e_7$$ $$A_2 = e_4 + e_5 + e_6 + e_7$$

Now I want to add an output which shows if more then one input is active. If only one input is active the valid output should be 1 otherwhise 0.

I don't know how to implement my valid function with AND, OR and NOT gates.

Does anyone have a hint for me?

EDIT:

This is a draft of the valid function:

V(e7,e6,e5,e4,e3,e2,e1)=
if      e7=1 and e6=0 and e5=0 and e4=0 and e3=0 and e2=0 and e1=0 then return 1
else if e7=0 and e6=1 and e5=0 and e4=0 and e3=0 and e2=0 and e1=0 then return 1
else if e7=0 and e6=0 and e5=1 and e4=0 and e3=0 and e2=0 and e1=0 then return 1
else if e7=0 and e6=0 and e5=0 and e4=1 and e3=0 and e2=0 and e1=0 then return 1
…
else if e7=0 and e6=0 and e5=0 and e4=0 and e3=0 and e2=0 and e1=1 then return 1

The truth table looks like the following:

The problem with the truth table is that I'm not able to create a kv diagram with 8 variables.

• What have you tried? Can you write a logic equation for the desired function? How many inputs can your AND and OR gates have...as many as you want? – Joe Hass Apr 13 '14 at 17:16
• the gates have many inputs as desired. I will edit my post when I wrote the function of the valid output. – Briefkasten Apr 13 '14 at 17:23
• How about starting with a truth table? – jippie Apr 13 '14 at 17:27
• I added the truth table – Briefkasten Apr 13 '14 at 17:35