Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bidirectional Mux/Demux 1

Status
Not open for further replies.

yanant

Programmer
May 12, 2005
2
GB
How can I design Mux/Demux on Bidirectional port? This code doesn't seem right? Any help will be great. Thanks.

yanant

entity MUX_DEMUX is
generic (n : integer);
port (
a : inout std_logic_vector(n-1 downto 0);
b : inout std_logic_vector(n-1 downto 0);
o : inout std_logic_vector(n-1 downto 0);
s : in std_logic_vector(1 downto 0));
end MUX_DEMUX;

architecture simple of MUX_DEMUX is
begin
process(s,a,b)
begin
case s is
when "01" => o <= a;
a <= o;
when "10" => o <= b;
b <= o;
when others => o <= (others=>'0');
end case;
end process;
end simple;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top