Problems with inout, please help!!

Joined
Oct 13, 2011
Messages
7
Reaction score
0
I try to make a sensor with one input a three inoutputs. If the sensor change its value, send the information for three outputs and if un inoupts receive sth it send the information to the rest but not by itself. This is my code, I hace latch beacuse I change the value in two different places, but i dont know hoy can i make it. Please help me.

Lectura is the port when the inout received something.
Ad1,2,3 is the acumulator to compare the value
d1,d2,d3 its the inout

if (lectura1='1' or lectura2='1' or lectura3='1') THEN
if (lectura1= '1' AND d1/=Ad1 AND lectura2 ='0' AND lectura3 ='0') THEN
d2<= d1;
d3<= d1;
Ad1 <= d1;
d1 <= d1;
Ad2<= Ad2;
Ad3<= Ad3;
elsif (lectura1= '0' AND d2/=Ad2 AND lectura2 ='1' AND lectura3 ='0') THEN
d1<= d2;
d3<= d2;
Ad1 <= Ad1;
d2 <= d2;
Ad2<= d2;
Ad3<= Ad3;
elsif (lectura1= '0' AND d3/=Ad3 AND lectura2 ='0' AND lectura3 ='1') THEN
d1<= d3;
d3<= d3;
Ad1 <= Ad1;
d2 <= d3;
Ad2<= Ad2;
Ad3<= d3;
else
d1<="00000000";
d2<="00000000";
d3<="00000000";
Ad2<= Ad2;
Ad1 <= Ad1;
Ad3<= Ad3;
end if;
else
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top