Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Multiple instantiation of a MUX

Status
Not open for further replies.

streetHawkk

Newbie level 5
Newbie level 5
Joined
May 14, 2012
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,359
Hi Friends,

Please guide me if my approach is not correct. Basically i have requirement where i need to use a MUX to access a shared memory from 4 different modules.
I have a multiplexer module with four possible selections as shown below.

MUX_AD
------
S1:S0 = "00", "01", "10" & "11"

Code VHDL - [expand]
1
2
3
4
5
6
7
entity MUX_AD is
(
* addra : IN std_logic_vector(4 downto 0);
* douta : OUT std_logic_vector(7 downto 0);
* sel   : IN std_logic_vector(1 downto 0)
);
end entity;


I have 4 components say A, B, C & D which requires to use this mux to access this memory.

Can i instantiate the MUX_AD in each of these different components and connect accordingly. Will this work.


Component A : selects S1:S0 = "00"
Component B : selects S1:S0 = "01"
Component C : selects S1:S0 = "10"
Component D : selects S1:S0 = "11"


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
========================
Component A (compA.vhdl)
-----------
 
signal compA_addra : std_logic_vector(4 downto 0);
signal compA_douta : std_logic_vector(7 downto 0);
signal compA_sel: std_logic_vector(1 downto 0);
 
Port mapping
------
  ap : MUX_AD PORT MAP(
    addra => compA_addra,
    douta => compA_douta,
    sel   => compA_sel
  )
 
========================
Component B  (compB.vhdl)
-----------
 
signal compB_addra : std_logic_vector(4 downto 0);
signal compB_douta : std_logic_vector(7 downto 0);
signal compB_sel: std_logic_vector(1 downto 0);
 
Port mapping
------
  ap : MUX_AD PORT MAP(
    addra => compB_addra,
    douta => compB_douta,
    sel   => compB_sel
  )


Similary for other 2 components C & D from separate vhdl files.

Thanks
Hwk
 

Hi Friends,

Please guide me if my approach is not correct. Basically i have requirement where i need to use a MUX to access a shared memory from 4 different modules.
I have a multiplexer module with four possible selections as shown below.

MUX_AD
------
S1:S0 = "00", "01", "10" & "11"

Code VHDL - [expand]
1
2
3
4
5
6
7
entity MUX_AD is
(
* addra : IN std_logic_vector(4 downto 0);
* douta : OUT std_logic_vector(7 downto 0);
* sel   : IN std_logic_vector(1 downto 0)
);
end entity;


I have 4 components say A, B, C & D which requires to use this mux to access this memory.

Can i instantiate the MUX_AD in each of these different components and connect accordingly. Will this work.


Component A : selects S1:S0 = "00"
Component B : selects S1:S0 = "01"
Component C : selects S1:S0 = "10"
Component D : selects S1:S0 = "11"


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
========================
Component A (compA.vhdl)
-----------
 
signal compA_addra : std_logic_vector(4 downto 0);
signal compA_douta : std_logic_vector(7 downto 0);
signal compA_sel: std_logic_vector(1 downto 0);
 
Port mapping
------
  ap : MUX_AD PORT MAP(
    addra => compA_addra,
    douta => compA_douta,
    sel   => compA_sel
  )
 
========================
Component B  (compB.vhdl)
-----------
 
signal compB_addra : std_logic_vector(4 downto 0);
signal compB_douta : std_logic_vector(7 downto 0);
signal compB_sel: std_logic_vector(1 downto 0);
 
Port mapping
------
  ap : MUX_AD PORT MAP(
    addra => compB_addra,
    douta => compB_douta,
    sel   => compB_sel
  )


Similary for other 2 components C & D from separate vhdl files.

Thanks
Hwk

1. i don't see the logic behind this mux you are using:
for a mux to work it needs to have data input of 4*8 bits.
instead you have something like address input of 5 bit seems wrong.

2. all this instansiation of this mux inside 4 components doesn't seems to have any sense or purpose, when you to access
a shared memory. what you need eventually is one mux connected to your memory and not 4.

3. hope i could help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top