Forum Discussion
Altera_Forum
Honored Contributor
16 years agoIn fact, demultiplexers aren't often used. Instead, a decoder providing clock-enable signals is preferred.
Nevertheless, your VHDL code must assign every signal in order to avoid parasite latches.
process(X,sel)
begin
case sel is
when "000"=>
A<=X;
B<=(others=>'0');
C<=(others=>'0');
D<=(others=>'0');
E<=(others=>'0');
F<=(others=>'0');
when "001" =>
A<=(others=>'0');
B<=X;
C<=(others=>'0');
D<=(others=>'0');
E<=(others=>'0');
F<=(others=>'0');
when "010" =>
A<=(others=>'0');
B<=(others=>'0');
C<=X;
D<=(others=>'0');
E<=(others=>'0');
F<=(others=>'0');
when "011" =>
A<=(others=>'0');
B<=(others=>'0');
C<=(others=>'0');
D<=X;
E<=(others=>'0');
F<=(others=>'0');
when "100" =>
A<=(others=>'0');
B<=(others=>'0');
C<=(others=>'0');
D<=(others=>'0');
E<=X;
F<=(others=>'0');
when "101" =>
A<=(others=>'0');
B<=(others=>'0');
C<=(others=>'0');
D<=(others=>'0');
E<=(others=>'0');
F<=X;
end case;
end process;