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!

VHDL Code for 4:1 Mux

Status
Not open for further replies.

kkadakia

MIS
Nov 21, 2005
8
US
Folks,

I am designing a 4:1 Mux using VHDL. I am using the Behavioral Style as the Architecture Body. What would my 'else' statement be ? My 4 'If' statements will choose the output as one of the inputs depending on the value of select lines.

Thanks.

-KK
 
KKadakia,

Your code should be like this for a pure combinatorical mux :

pMux : process (A,B,C,D,Sel)
begin
case Sel is
when "00" => out <= A;
when "01" => out <= B;
when "10" => out <= C;
when others => out <= D;
end case;
end process pMux;

A,B,C,D and out can be either what but should be of the same
type.

regards

jeandelfrigo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top