C
conradojr
Guest
Hi.
In first place, sorry for my bad English. I have a problem/question:
I constructed one mux 1x1 with 128 bits input and 16 bits output:
-------------------------------------------------------------------------------
--
-- Project : Multiplexer 1x1
-- File name : mux_1x1_128x16bits.vhd
-- Title : Multiplexer 1 input x 1 output
-- Description : Multiplexer 1 input x 1 output 128x16 bits.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY mux_1x1_128x16bits IS
GENERIC
(
bits : integer:= 16;
word : integer:= 8
);
PORT
(
I : IN STD_LOGIC_VECTOR(bits * word - 1 DOWNTO bits - bits);
-- Q(7)Q(6)Q(5)Q(4)Q(3)Q(2)Q(1)Q(0)
selector : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
O : OUT STD_LOGIC_VECTOR(bits - 1 DOWNTO bits - bits)
);
END mux_1x1_128x16bits;
ARCHITECTURE a OF mux_1x1_128x16bitss IS
BEGIN
mux:
FOR x IN 0 TO word - 1 GENERATE
IF (selector = "???") THEN
O <= I(((x * bits) + 15) DOWNTO (x * bits));
END IF;
END GENERATE;
END a;
It has a true-table below:
Selector 000 = Q0
Selector 001 = Q1
Selector 010 = Q2
Selector 011 = Q3
Selector 100 = Q4
Selector 101 = Q5
Selector 110 = Q6
Selector 111 = Q7
in Q0 state the output is O <= I(15 DOWNTO 0)
in Q1 state the output is O <= I(31 DOWNTO 16)
in Q2 state the output is O <= I(47 DOWNTO 32)
in Q3 state the output is O <= I(63 DOWNTO 48)
in Q4 state the output is O <= I(79 DOWNTO 64)
in Q5 state the output is O <= I(95 DOWNTO 80)
in Q6 state the output is O <= I(111 DOWNTO 96)
in Q7 state the output is O <= I(127 DOWNTO 112)
My question is:
Now I constructed a mux to 128 bits, but I will have many others mux,
with different values in input OR output. I need a function to
calculate automatically a "???".
IF (selector = "???") THEN
How to make this?
I do not know if I was enough clearly
Grateful
Conrado Jr.
In first place, sorry for my bad English. I have a problem/question:
I constructed one mux 1x1 with 128 bits input and 16 bits output:
-------------------------------------------------------------------------------
--
-- Project : Multiplexer 1x1
-- File name : mux_1x1_128x16bits.vhd
-- Title : Multiplexer 1 input x 1 output
-- Description : Multiplexer 1 input x 1 output 128x16 bits.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY mux_1x1_128x16bits IS
GENERIC
(
bits : integer:= 16;
word : integer:= 8
);
PORT
(
I : IN STD_LOGIC_VECTOR(bits * word - 1 DOWNTO bits - bits);
-- Q(7)Q(6)Q(5)Q(4)Q(3)Q(2)Q(1)Q(0)
selector : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
O : OUT STD_LOGIC_VECTOR(bits - 1 DOWNTO bits - bits)
);
END mux_1x1_128x16bits;
ARCHITECTURE a OF mux_1x1_128x16bitss IS
BEGIN
mux:
FOR x IN 0 TO word - 1 GENERATE
IF (selector = "???") THEN
O <= I(((x * bits) + 15) DOWNTO (x * bits));
END IF;
END GENERATE;
END a;
It has a true-table below:
Selector 000 = Q0
Selector 001 = Q1
Selector 010 = Q2
Selector 011 = Q3
Selector 100 = Q4
Selector 101 = Q5
Selector 110 = Q6
Selector 111 = Q7
in Q0 state the output is O <= I(15 DOWNTO 0)
in Q1 state the output is O <= I(31 DOWNTO 16)
in Q2 state the output is O <= I(47 DOWNTO 32)
in Q3 state the output is O <= I(63 DOWNTO 48)
in Q4 state the output is O <= I(79 DOWNTO 64)
in Q5 state the output is O <= I(95 DOWNTO 80)
in Q6 state the output is O <= I(111 DOWNTO 96)
in Q7 state the output is O <= I(127 DOWNTO 112)
My question is:
Now I constructed a mux to 128 bits, but I will have many others mux,
with different values in input OR output. I need a function to
calculate automatically a "???".
IF (selector = "???") THEN
How to make this?
I do not know if I was enough clearly
Grateful
Conrado Jr.