Connecting two bidirectional ports together

VJN

Joined
Jun 6, 2007
Messages
2
Reaction score
0
Hi,

Previously I heard that " it is impossible to connect two bidirectional port together in VHDL without any enable signals ":???:
But tried like this,

Way 1

***********************************************
entity dec
CPU_I2C_SDA :inout std_logic;
I2C_SDA_MC :inout std_logic;

signal declared
signal enable1 : std_logic;
signal enable2 : std_logic;


Logic starts here..........

enable1 <= '1';
process(enable1)
begin
if enable1 ='1' then
CPU_I2C_SDA <= I2C_SDA_MC ;
else
CPU_I2C_SDA <= 'Z';
end if;
end process;

enable2 <= '1';
process(enable2)
begin
if enable2 ='1' then
I2C_SDA_MC <= CPU_I2C_SDA ;
else
I2C_SDA_MC <= 'Z';
end if;
end process;
***********************************************

Way 2:

***********************************************
process(I2C_SDA_MC )
begin
if I2C_SDA_MC = '0' then
CPU_I2C_SDA <= '0';
elsif I2C_SDA_MC = '1' then
CPU_I2C_SDA <= '1';
else
CPU_I2C_SDA <= 'Z';
end if;
end process;

process(CPU_I2C_SDA)
begin
if CPU_I2C_SDA = '0' then
I2C_SDA_MC <= '0';
elsif CPU_I2C_SDA = '1' then
I2C_SDA_MC <= '1';
else
I2C_SDA_MC <='Z';
end if;
end process;

********************************************

In this both logic, I got the ERROR during compilation.

Can anyone share why the error came ?:tea:

-V
 

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

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top