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.

VHDL 16x4 Mux? Whats the code for it?

Status
Not open for further replies.

imconfused

Newbie level 4
Joined
Sep 9, 2012
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
How do you code a 16x4 MUX? I have to code a compressor, I know how to code the smaller mux such s 4x1 but I have no clue how to code this. Help please?
 

do you mean 16 inputs and 4 outputs? or 16 inputs and 1x4bit output?

For the first case, that would just be 4x 16x1 muxes.
 
thanks!

I used 4 16x1 muxes and it seems to be working.
 

-- 16*1 MUX using 4 4*1 MUX
library ieee;
use ieee.std_logic_1164.all;
entity mux16 is
port(a:in std_logic_vector(0 to 15);sel:in std_logic_vector(0 to 3);
y:eek:ut std_logic);
end mux16;
architecture mux16arc of mux16 is
component mux4 is
port(sel:in std_logic_vector(0 to 1);a:in std_logic_vector(0 to 3);
y:eek:ut std_logic);
end component;
signal t:std_logic_vector(0 to 3);
begin
x1:mux4 port map(sel(0 to 1),a(0 to 3),t(0));
x2:mux4 port map(sel(0 to 1),a(4 to 7),t(1));
x3:mux4 port map(sel(0 to 1),a(8 to 11),t(2));
x4:mux4 port map(sel(0 to 1),a(12 to 15),t(3));
x5:mux4 port map(sel(2 to 3),t,y);
end mux16arc;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top