jackslap442
Programmer
I have created an 8 to 1 mux package. I now wish to use this package in another file but cant get the port mapping right. The package compiles without error and I have included the work library in the file in which i am using the package. Sample code below.
--Mux package
entity mux8t01
port(I :IN STD_LOGIC_VECTOR(7 DOWNTO 0);
S :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
Z :OUT STD_LOGIC);
end mux8t01
ARCHITECTURE behavior of mux8to1 is
BEGIN
WITH S SELECT
Z<=I(0) WHEN "000"
I(1) WHEN "001"
I(2) WHEN "010"
I(3) WHEN "011"
I(4) WHEN "100"
I(5) WHEN "101"
I(6) WHEN "110"
I(7) WHEN OTHERS
END behavior
.
.
package code....same ports as above
.
.
_____________________________________________________
--OTHER FILE TO USE PACKAGE
--work lib included
entity other
port(E,L,G,a1 :IN STD_LOGIC;
II :OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
S :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
END other
ARCHITECTURE logic OF other IS
II(0)<=(E AND NOT a1) OR (G AND a1);
.
.
.similar logic forII(1)-II(7)
.
.
end logic
________________________________________________________
So, if someone could help me with the port mapping of the other file with the mux package i would be
thnx,
jackslap442
--Mux package
entity mux8t01
port(I :IN STD_LOGIC_VECTOR(7 DOWNTO 0);
S :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
Z :OUT STD_LOGIC);
end mux8t01
ARCHITECTURE behavior of mux8to1 is
BEGIN
WITH S SELECT
Z<=I(0) WHEN "000"
I(1) WHEN "001"
I(2) WHEN "010"
I(3) WHEN "011"
I(4) WHEN "100"
I(5) WHEN "101"
I(6) WHEN "110"
I(7) WHEN OTHERS
END behavior
.
.
package code....same ports as above
.
.
_____________________________________________________
--OTHER FILE TO USE PACKAGE
--work lib included
entity other
port(E,L,G,a1 :IN STD_LOGIC;
II :OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
S :IN STD_LOGIC_VECTOR(2 DOWNTO 0);
END other
ARCHITECTURE logic OF other IS
II(0)<=(E AND NOT a1) OR (G AND a1);
.
.
.similar logic forII(1)-II(7)
.
.
end logic
________________________________________________________
So, if someone could help me with the port mapping of the other file with the mux package i would be
thnx,
jackslap442